where 条件 先后顺序 PREDICATES: 3 1
CREATE TABLE `test_table` (
`shop_id` int(11) NOT NULL COMMENT "",
`item_id` bigint(20) NOT NULL COMMENT "",
`x` bitmap BITMAP_UNION NULL COMMENT ""
) ENGINE=OLAP
AGGREGATE KEY(`shop_id`, `item_id`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`item_id`)
PROPERTIES (
"replication_num" = "1",
"datacache.enable" = "true",
"storage_volume" = "df_volume",
"enable_async_write_back" = "false",
"enable_persistent_index" = "false",
"compression" = "LZ4"
);
[shop_id 在后 ]
explain SELECT item_id
FROM test_table
WHERE
item_id IN (123,456,789)
and shop_id=97
Explain String |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
PLAN FRAGMENT 0 |
OUTPUT EXPRS:3: item_id |
PARTITION: UNPARTITIONED |
|
RESULT SINK |
|
2:EXCHANGE |
|
PLAN FRAGMENT 1 |
OUTPUT EXPRS: |
PARTITION: RANDOM |
|
STREAM DATA SINK |
EXCHANGE ID: 02 |
UNPARTITIONED |
|
1:Project |
| <slot 3> : 3: item_id |
| |
0:OlapScanNode |
TABLE: test_table |
PREAGGREGATION: OFF. Reason: None aggregate function |
PREDICATES: 3: item_id IN (123,456,789|
partitions=1/1 |
rollup: test_table |
tabletRatio=7/10 |
tabletList=190,191,195,192,193,199,197 |
cardinality=1 |
avgRowSize=12.0
[shop_id 在前 ]
explain SELECT item_id
FROM test_table
WHERE
shop_id=97 and
item_id IN (123,456,789)
Explain String |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
PLAN FRAGMENT 0 |
OUTPUT EXPRS:3: item_id |
PARTITION: UNPARTITIONED |
|
RESULT SINK |
|
2:EXCHANGE |
|
PLAN FRAGMENT 1 |
OUTPUT EXPRS: |
PARTITION: RANDOM |
|
STREAM DATA SINK |
EXCHANGE ID: 02 |
UNPARTITIONED |
|
1:Project |
| <slot 3> : 3: item_id |
| |
0:OlapScanNode |
TABLE: test_table |
PREAGGREGATION: OFF. Reason: None aggregate function |
PREDICATES: 1: shop_id = 97, 3: item_id IN (123,456,789
partitions=1/1 |
rollup: test_table |
tabletRatio=7/10 |
tabletList=190,191,195,192,193,199,197 |
cardinality=20 |
avgRowSize=12.0 | |