SQLite

Check-in [7a1e30a17f]
Login

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

Overview
Comment:Another very small performance improvement.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | filter-clause
Files: files | file ages | folders
SHA3-256: 7a1e30a17f57ca006dd84b6f97b0c7811bf4c6da4b02903452ffc4bc363cab9b
User & Date: dan 2019-07-05 19:10:41.614
Context
2019-07-10
20:16
Minor performance improvement in sqlite3ExprDeleteNN(). (check-in: bcc8b38ac7 user: dan tags: filter-clause)
2019-07-05
19:10
Another very small performance improvement. (check-in: 7a1e30a17f user: dan tags: filter-clause)
17:38
Minor tweak to patch on this branch to reclaim some cycles. (check-in: 81eed055de user: dan tags: filter-clause)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/prepare.c.
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
  }
  if( pzTail ){
    *pzTail = sParse.zTail;
  }
  rc = sParse.rc;

#ifndef SQLITE_OMIT_EXPLAIN
  if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){
    static const char * const azColName[] = {
       "addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment",
       "id", "parent", "notused", "detail"
    };
    int iFirst, mx;
    if( sParse.explain==2 ){
      sqlite3VdbeSetNumCols(sParse.pVdbe, 4);







|







631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
  }
  if( pzTail ){
    *pzTail = sParse.zTail;
  }
  rc = sParse.rc;

#ifndef SQLITE_OMIT_EXPLAIN
  if( sParse.explain && rc==SQLITE_OK && sParse.pVdbe ){
    static const char * const azColName[] = {
       "addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment",
       "id", "parent", "notused", "detail"
    };
    int iFirst, mx;
    if( sParse.explain==2 ){
      sqlite3VdbeSetNumCols(sParse.pVdbe, 4);
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
    }
  }
#endif

  if( db->init.busy==0 ){
    sqlite3VdbeSetSql(sParse.pVdbe, zSql, (int)(sParse.zTail-zSql), prepFlags);
  }
  if( sParse.pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){
    sqlite3VdbeFinalize(sParse.pVdbe);
    assert(!(*ppStmt));
  }else{
    *ppStmt = (sqlite3_stmt*)sParse.pVdbe;
  }

  if( zErrMsg ){
    sqlite3ErrorWithMsg(db, rc, "%s", zErrMsg);







|
|







656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
    }
  }
#endif

  if( db->init.busy==0 ){
    sqlite3VdbeSetSql(sParse.pVdbe, zSql, (int)(sParse.zTail-zSql), prepFlags);
  }
  if( rc!=SQLITE_OK || db->mallocFailed ){
    if( sParse.pVdbe ) sqlite3VdbeFinalize(sParse.pVdbe);
    assert(!(*ppStmt));
  }else{
    *ppStmt = (sqlite3_stmt*)sParse.pVdbe;
  }

  if( zErrMsg ){
    sqlite3ErrorWithMsg(db, rc, "%s", zErrMsg);
Changes to test/window2.tcl.
424
425
426
427
428
429
430



431
432
433
434
435
  WINDOW win AS (ORDER BY 1);
}

execsql_test 4.10 {
  SELECT count(*) OVER (ORDER BY b) FROM t1
}






finish_test









>
>
>





424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
  WINDOW win AS (ORDER BY 1);
}

execsql_test 4.10 {
  SELECT count(*) OVER (ORDER BY b) FROM t1
}

execsql_test 4.11 {
  SELECT count(distinct a) FILTER (WHERE b='odd') FROM t1
}


finish_test


Changes to test/window2.test.
892
893
894
895
896
897
898




899
900
  }
  set {} {}
} {}

do_execsql_test 4.10 {
  SELECT count(*) OVER (ORDER BY b) FROM t1
} {3   3   3   6   6   6}





finish_test







>
>
>
>


892
893
894
895
896
897
898
899
900
901
902
903
904
  }
  set {} {}
} {}

do_execsql_test 4.10 {
  SELECT count(*) OVER (ORDER BY b) FROM t1
} {3   3   3   6   6   6}

do_execsql_test 4.11 {
  SELECT count(distinct a) FILTER (WHERE b='odd') FROM t1
} {3}

finish_test