/ Check-in [0bf7b518]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:R-TREE optimization: unwrap the coordinate decode loop in rtreeCallbackConstraint().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0bf7b51896ec441f62490964c7a44a3c75c6b7e2
User & Date: drh 2017-01-31 21:22:03
Context
2017-02-01
01:34
Improved comments on the statGet() implementation in ANALYZE. No changes to code. check-in: 9663eea2 user: drh tags: trunk
2017-01-31
21:22
R-TREE optimization: unwrap the coordinate decode loop in rtreeCallbackConstraint(). check-in: 0bf7b518 user: drh tags: trunk
19:10
Very small performance improvements and size reductions in sqlite3VdbeExec() and blobSeekToRow(). check-in: 85dddf2b user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/rtree/rtree.c.

962
963
964
965
966
967
968



969
970
971
972



973
974
975
976
977
978
979

  assert( pConstraint->op==RTREE_MATCH || pConstraint->op==RTREE_QUERY );
  assert( nCoord==2 || nCoord==4 || nCoord==6 || nCoord==8 || nCoord==10 );

  if( pConstraint->op==RTREE_QUERY && pSearch->iLevel==1 ){
    pInfo->iRowid = readInt64(pCellData);
  }



  pCellData += 8;
  for(i=0; i<nCoord; i++, pCellData += 4){
    RTREE_DECODE_COORD(eInt, pCellData, aCoord[i]);
  }



  if( pConstraint->op==RTREE_MATCH ){
    rc = pConstraint->u.xGeom((sqlite3_rtree_geometry*)pInfo,
                              nCoord, aCoord, &i);
    if( i==0 ) *peWithin = NOT_WITHIN;
    *prScore = RTREE_ZERO;
  }else{
    pInfo->aCoord = aCoord;







>
>
>
|
<

<
>
>
>







962
963
964
965
966
967
968
969
970
971
972

973

974
975
976
977
978
979
980
981
982
983

  assert( pConstraint->op==RTREE_MATCH || pConstraint->op==RTREE_QUERY );
  assert( nCoord==2 || nCoord==4 || nCoord==6 || nCoord==8 || nCoord==10 );

  if( pConstraint->op==RTREE_QUERY && pSearch->iLevel==1 ){
    pInfo->iRowid = readInt64(pCellData);
  }
  assert( nCoord>=2 && (nCoord&1)==0 );
  i = 0;
  do{
    pCellData += 8;

    RTREE_DECODE_COORD(eInt, pCellData, aCoord[i]);

    RTREE_DECODE_COORD(eInt, (pCellData+4), aCoord[i+1]);
    i+= 2;
  }while( i<nCoord );
  if( pConstraint->op==RTREE_MATCH ){
    rc = pConstraint->u.xGeom((sqlite3_rtree_geometry*)pInfo,
                              nCoord, aCoord, &i);
    if( i==0 ) *peWithin = NOT_WITHIN;
    *prScore = RTREE_ZERO;
  }else{
    pInfo->aCoord = aCoord;