Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.11.0
Description
The limit is not pushed to JDBC storage plugin.
The following query:
select person_id from mysql.`drill_mysql_test`.person limit 10
Returns plan:
00-00 Screen 00-01 Project(person_id=[$0]) 00-02 SelectionVectorRemover 00-03 Limit(fetch=[10]) 00-04 Limit(fetch=[10]) 00-05 Jdbc(sql=[SELECT `person_id` FROM `drill_mysql_test`.`person` ])
This issue happens since incorrect row count is calculated for JdbcSort.
Drill enforces to use RelNode.estimateRowCount(mq) for calculating row count for all inheritants of Sort rel node (see DrillRelMdRowCount), but JdbcSort doesn't override this method and uses parent one which returns row count of input. So planner choses DrillLimitRel since it has less row count.
Attachments
Attachments
Issue Links
- relates to
-
DRILL-7771 Order by and limit transactions in RDBMS cannot be pushdown
- Resolved
- links to