Bug #38793 | NDBAPI : EQ never sent for Index scan bounds | ||
---|---|---|---|
Submitted: | 14 Aug 2008 11:45 | Modified: | 17 Mar 2009 20:12 |
Reporter: | Frazer Clement | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Cluster: NDB API | Severity: | S5 (Performance) |
Version: | mysql-5.1-telco-6.2 | OS: | Any |
Assigned to: | Frazer Clement | CPU Architecture: | Any |
[14 Aug 2008 11:45]
Frazer Clement
[10 Mar 2009 17:06]
Frazer Clement
Potential patch for bug
Attachment: idx_scan_eq_2.patch (text/x-patch), 3.02 KiB.
[10 Mar 2009 17:15]
Frazer Clement
Proposed patch : - Compares low and high key bound ptrs, counts and inclusivity bits for equality. - If they are equal, sends all column bounds with BoundEQ type, only once. Written against 6.3, could be applied to 6.2+ Benefits : - Low overhead to test equality - No API changes required - Covers 'main' use case of EQ on a set of key columns. Limitations : - Column values themselves are not compared for equality - If ptrs are unequal, but values are the same, separate lower and upper values will be sent - If key counts are unequal, but values are the same, separate lower and upper values will be sent. Potential extensions : - If there's a compelling use case to send EQ bounds for cases not covered above, some new API can be added to supply : - An 'eq_prefix_length' indicating how many leading columns are equal : Seems like next-most-useful use case for using EQ? - An 'eq_columns_mask' indicating which columns are equal : More general purpose than above, harder to use.
[10 Mar 2009 17:19]
Jonas Oreland
i think patch is ok, i would move "bool isEqBound" to where it gets it's value, i.e const bool isEqBound i limitations and extensions can be left for later... but it sounds like a good idea documenting them, somewhere, maybe in header or code
[17 Mar 2009 10:49]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/69402 2880 Frazer Clement 2009-03-17 Bug#38793 NDBAPI : EQ never sent for Index scan bounds NdbRecord ordered index scans currently express an EQ range as separate lower and upper bounds. This results in 2 copies of EQ column values being sent to the kernel which is inefficient. This patch detects when an equal range is specified by comparing the passed pointers, key lengths and inclusive bits and sending only one copy of the equal key columns. This halves the amount of KeyInfo sent for an EQ range. modified: storage/ndb/src/ndbapi/NdbScanOperation.cpp
[17 Mar 2009 11:09]
Bugs System
Pushed into 5.1.32-ndb-7.0.4 (revid:frazer@mysql.com-20090317110610-j98iyp964fo60z9i) (version source revid:frazer@mysql.com-20090317110610-j98iyp964fo60z9i) (merge vers: 5.1.32-ndb-7.0.4) (pib:6)
[17 Mar 2009 11:09]
Bugs System
Pushed into 5.1.32-ndb-6.3.24 (revid:frazer@mysql.com-20090317105107-mazbi3jc552xcqfe) (version source revid:frazer@mysql.com-20090317105107-mazbi3jc552xcqfe) (merge vers: 5.1.32-ndb-6.3.24) (pib:6)
[17 Mar 2009 11:11]
Bugs System
Pushed into 5.1.32-ndb-6.2.18 (revid:frazer@mysql.com-20090317104838-3vcb6kalv8j0ua3d) (version source revid:frazer@mysql.com-20090317104838-3vcb6kalv8j0ua3d) (merge vers: 5.1.32-ndb-6.2.18) (pib:6)
[17 Mar 2009 20:12]
Jon Stephens
Documented bugfix in the NDB-6.2.18, 6.3.24, and 7.0.4 changelogs as follows: Ordered index scans using NdbRecord formerly expressed an EQ range as separate lower and upper bounds, resulting in 2 copies of EQ column values being sent to the NDB kernel. Now, when a range is specified by NdbScanOperation::setBound(), the passed pointers, key lengths, and inclusive bits are compared, and only one copy of the equal key columns is sent to the kernel. This makes makes such operation more efficient, as half the amount of KeyInfo is now sent for an EQ range as before.