Performance optimizations in the rtreeStepToLeaf() routine of RTree.

FossilOrigin-Name: 4e34e3615ff31f4a6432033797b2e1a6604007ea0e501d714ecb362632776150
This commit is contained in:
drh 2019-07-20 17:43:28 +00:00
parent e04c1ec52a
commit bcb0e64c82
3 changed files with 15 additions and 10 deletions

View File

@ -1564,13 +1564,14 @@ static int rtreeStepToLeaf(RtreeCursor *pCur){
eInt = pRtree->eCoordType==RTREE_COORD_INT32;
while( (p = rtreeSearchPointFirst(pCur))!=0 && p->iLevel>0 ){
u8 *pCellData;
pNode = rtreeNodeOfFirstSearchPoint(pCur, &rc);
if( rc ) return rc;
nCell = NCELL(pNode);
assert( nCell<200 );
pCellData = pNode->zData + (4+pRtree->nBytesPerCell*p->iCell);
while( p->iCell<nCell ){
sqlite3_rtree_dbl rScore = (sqlite3_rtree_dbl)-1;
u8 *pCellData = pNode->zData + (4+pRtree->nBytesPerCell*p->iCell);
eWithin = FULLY_WITHIN;
for(ii=0; ii<nConstraint; ii++){
RtreeConstraint *pConstraint = pCur->aConstraint + ii;
@ -1583,10 +1584,14 @@ static int rtreeStepToLeaf(RtreeCursor *pCur){
}else{
rtreeNonleafConstraint(pConstraint, eInt, pCellData, &eWithin);
}
if( eWithin==NOT_WITHIN ) break;
if( eWithin==NOT_WITHIN ){
p->iCell++;
pCellData += pRtree->nBytesPerCell;
break;
}
}
p->iCell++;
if( eWithin==NOT_WITHIN ) continue;
p->iCell++;
x.iLevel = p->iLevel - 1;
if( x.iLevel ){
x.id = readInt64(pCellData);

View File

@ -1,5 +1,5 @@
C New\stest\scases\sadded\sto\stest/fuzzdata8.db.
D 2019-07-19T15:03:54.627
C Performance\soptimizations\sin\sthe\srtreeStepToLeaf()\sroutine\sof\sRTree.
D 2019-07-20T17:43:28.746
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -376,7 +376,7 @@ F ext/repair/test/checkindex01.test b530f141413b587c9eb78ff734de6bb79bc3515c3350
F ext/repair/test/test.tcl 686d76d888dffd021f64260abf29a55c57b2cedfa7fc69150b42b1d6119aac3c
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
F ext/rtree/geopoly.c c591164125808f8bba9659e92665b78412cd263e654b6f05294f3a8da7cdd9fb
F ext/rtree/rtree.c 78c0d989c32e5baac471f0463e83cda5006c7e71ded39d633b5fc001a301a26e
F ext/rtree/rtree.c f3ec2d1e2c0612f8141238db27cf31cf7cf580b732df7e434b05017534982a67
F ext/rtree/rtree.h 4a690463901cb5e6127cf05eb8e642f127012fd5003830dbc974eca5802d9412
F ext/rtree/rtree1.test 7573134f1b4f59df36c1b0a6de51268fd3b9c714d91f3811482263e734e416ea
F ext/rtree/rtree2.test 5f25b01acd03470067a2d52783b2eb0a50bf836803d4342d20ca39e541220fe2
@ -1837,7 +1837,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P bbfb2908ecd113c88e69a0984cbe2550463cdd3a67648b0e4e3578e80630136e
R 5a85ae3ae1027e3f5ee069edd22aa979
P 39be3c61bd809cc89bdfdba90afc391ac9c2f81dfd8bb68a9b085b0ca8cd1fba
R de7d7098bb99bd8f8735d10910c84616
U drh
Z f717511e26c039f3661c75c518b1037a
Z 8667389b078bb1f50542b3cd2f653cd6

View File

@ -1 +1 @@
39be3c61bd809cc89bdfdba90afc391ac9c2f81dfd8bb68a9b085b0ca8cd1fba
4e34e3615ff31f4a6432033797b2e1a6604007ea0e501d714ecb362632776150