You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SPJ: Mayor refactoring of ha_ndbcluster_push.cc and the logic which build
the pushed query (or: NdbQueryDef).
Previously the NdbQueryDef was build incremenataly as we analyzed the query
plan for pushable operations. This had the disadvantage that we could take
descission about parent - child relations at this stage which later prevented
other child candidates to be appended to the pushed query.
This refactoring extends 'class ndb_pushed_builder_ctx' such that it
collects intermediate information about pushable operation, and possible
parent candidates for each child operation. Furthermore, it
breaks the pushability logic into multiple passes:
1 ANALYZE:
Analyze each child candidate and add it to
'ndb_pushed_builder_ctx::m_join_scope' as
'pushable' if it qualifies as such. In addition possible parent
candidates, and required (forced) parent dependencies are collected
for each table. All non pushable operations should be identified
during this pass such that only known pushable operations remains.
2 OPTIMIZE:
Determine the parent to be used among the set of possible
parents. This is decided based on simple heuristic where
the goal is to employ conditional filters as soon as possible,
reduce the fanout of intermediate results, and utilize
the parallelism of the SPJ block whenever considdered optimal.
3 BUILD:
Build the NdbQueryDef.
The primary goal of this refactoring has been to provide a better platform
for later improving the efficiency of the pushed queries being produced.
It has not been the goal of this refactoring to change the pushability
of any query in the existing MTR testsuite. However a few queries has improved
its pushability as the 'analyze' phase now are able to force an artificial
sequential dependency between tables which enables more child operations to be
appended to the pushed query.
Copy file name to clipboardExpand all lines: mysql-test/suite/ndb/r/ndb_gis.result
+4-4
Original file line number
Diff line number
Diff line change
@@ -406,8 +406,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
406
406
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
407
407
1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
408
408
Warnings:
409
-
Note 1644 Table 'g1' not pushable, select list can't contain BLOB columns
410
-
Note 1644 Table 'g2' not pushable, select list can't contain BLOB columns
409
+
Note 1644 Table 'g1' is not pushable: select list can't contain BLOB columns
410
+
Note 1644 Table 'g2' is not pushable: select list can't contain BLOB columns
411
411
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
412
412
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
413
413
CREATE TABLE t1 (
@@ -960,8 +960,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
960
960
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
961
961
1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
962
962
Warnings:
963
-
Note 1644 Table 'g1' not pushable, select list can't contain BLOB columns
964
-
Note 1644 Table 'g2' not pushable, select list can't contain BLOB columns
963
+
Note 1644 Table 'g1' is not pushable: select list can't contain BLOB columns
964
+
Note 1644 Table 'g2' is not pushable: select list can't contain BLOB columns
965
965
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
966
966
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
0 commit comments