greenlion / warp

WarpSQL Server, an open source OLAP focused distribution of the world's most popular open source database bundled with OLAP performance related plugins such as the WARP storage engine..
http://warpsql.blog
Other
41 stars 2 forks source link

Push numeric comparisons to strings to MySQL layer #48

Closed greenlion closed 3 years ago

greenlion commented 3 years ago

where textcol < 1 can not be evaluated by Fastbit and returns wrong results. Comparisons between strings and integers need to be handled at the MySQL layer.

greenlion commented 3 years ago

Fixed in enhanced_ecp branch

mysql> explain analyze select count(*) from t2 where c2 > 'a'; +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ EXPLAIN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -> Aggregate: count(0) (actual time=0.248..0.248 rows=1 loops=1) -> Filter: (t2.c2 > 'a') (cost=0.46 rows=1) (actual time=0.247..0.247 rows=1 loops=1) -> Table scan on t2 (cost=0.46 rows=4) (actual time=0.243..0.245 rows=4 loops=1)

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.02 sec)

mysql> explain analyze select count(*) from t2 where c2 = 'a'; +----------------------------------------------------------------------------------------------------------------------------------------------------------+ EXPLAIN +----------------------------------------------------------------------------------------------------------------------------------------------------------+ -> Aggregate: count(0) (actual time=1.357..1.357 rows=1 loops=1) -> Table scan on t2 (cost=0.46 rows=4) (actual time=1.345..1.352 rows=3 loops=1)

+----------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.02 sec)