SQLite

Check-in [2b9258b8b0]
Login

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

Overview
Comment:Performance improvement: Avoid using sqlite3WalkerSelectExpr() and sqlite3WalkerSelectFrom() twice, so that the compiler will in-line their implementation.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | ticket-f09fcd17810f
Files: files | file ages | folders
SHA3-256: 2b9258b8b0342330ebe8c22b59ec276fd042a05547d15b24fdf29e16280868de
User & Date: drh 2018-12-06 22:12:18.890
Context
2018-12-07
01:56
Fix the sqlite3ExprDup() function so that it correctly duplicates the Window object list on a Select that contains window functions. Fix for ticket [f09fcd17810f65f717]. (check-in: db5ed2268e user: drh tags: trunk)
2018-12-06
22:12
Performance improvement: Avoid using sqlite3WalkerSelectExpr() and sqlite3WalkerSelectFrom() twice, so that the compiler will in-line their implementation. (Closed-Leaf check-in: 2b9258b8b0 user: drh tags: ticket-f09fcd17810f)
22:04
Fix the sqlite3ExprDup() routine so that it makes complete duplications of subqueries containing window functions. (check-in: 940174543e user: drh tags: ticket-f09fcd17810f)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/expr.c.
1341
1342
1343
1344
1345
1346
1347



1348
1349
1350

1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
  if( pExpr->op==TK_FUNCTION && pExpr->y.pWin!=0 ){
    assert( ExprHasProperty(pExpr, EP_WinFunc) );
    pExpr->y.pWin->pNextWin = pWalker->u.pSelect->pWin;
    pWalker->u.pSelect->pWin = pExpr->y.pWin;
  }
  return WRC_Continue;
}



static void gatherSelectWindows(Select *p){
  Walker w;
  w.xExprCallback = gatherSelectWindowsCallback;

  w.xSelectCallback = 0;
  w.u.pSelect = p;
  sqlite3WalkSelectExpr(&w, p);
  sqlite3WalkSelectFrom(&w, p);
}
#endif


/*
** The following group of routines make deep copies of expressions,
** expression lists, ID lists, and select statements.  The copies can







>
>
>



>
|

|
<







1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357

1358
1359
1360
1361
1362
1363
1364
  if( pExpr->op==TK_FUNCTION && pExpr->y.pWin!=0 ){
    assert( ExprHasProperty(pExpr, EP_WinFunc) );
    pExpr->y.pWin->pNextWin = pWalker->u.pSelect->pWin;
    pWalker->u.pSelect->pWin = pExpr->y.pWin;
  }
  return WRC_Continue;
}
static int gatherSelectWindowsSelectCallback(Walker *pWalker, Select *p){
  return p==pWalker->u.pSelect ? WRC_Continue : WRC_Prune;
}
static void gatherSelectWindows(Select *p){
  Walker w;
  w.xExprCallback = gatherSelectWindowsCallback;
  w.xSelectCallback = gatherSelectWindowsSelectCallback;
  w.xSelectCallback2 = 0;
  w.u.pSelect = p;
  sqlite3WalkSelect(&w, p);

}
#endif


/*
** The following group of routines make deep copies of expressions,
** expression lists, ID lists, and select statements.  The copies can