1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

The top of an index equality loop normally starts with OP_SeekGE and OP_IdxGT.

This check-in adds a flag to OP_SeekGE such that it fails immediately if
the key is not equal, then jumps over the OP_IdxGT, saving a call to the key
comparison functions.  Consider this check-in a proof-of-concept.  It needs 
improvement before going on trunk.  Some tests fail, but only because they
new use fewer key comparisons than expected (which is a good thing!).

FossilOrigin-Name: 32e31b9bc8664afcd326a1ff3892d86dc5202474
This commit is contained in:
drh
2015-11-05 20:25:09 +00:00
parent d82211db56
commit 70528d7868
7 changed files with 39 additions and 16 deletions

View File

@@ -1830,12 +1830,13 @@ struct KeyInfo {
*/
struct UnpackedRecord {
KeyInfo *pKeyInfo; /* Collation and sort-order information */
Mem *aMem; /* Values */
u16 nField; /* Number of entries in apMem[] */
i8 default_rc; /* Comparison result if keys are equal */
u8 errCode; /* Error detected by xRecordCompare (CORRUPT or NOMEM) */
Mem *aMem; /* Values */
int r1; /* Value to return if (lhs > rhs) */
int r2; /* Value to return if (rhs < lhs) */
i8 r1; /* Value to return if (lhs > rhs) */
i8 r2; /* Value to return if (rhs < lhs) */
u8 eqSeen; /* True if an equality comparison has been seen */
};