/ Check-in [06c2db87]
Login

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

Overview
Comment:More efficient removal of duplicates in recursive queries using the UNION compound operator.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 06c2db875e6cabd81c2a153b2fa4aba03eaed268
User & Date: drh 2014-02-26 21:35:31
Context
2014-02-27
15:04
Add #defines to the command-line shell source code (shell.c) so that it can be imported directly into other projects (ex: Fossil) and used without editing. check-in: a6690400 user: drh tags: trunk
05:47
Merge updates from trunk. check-in: ed0bfcfa user: mistachkin tags: winIoRetry
2014-02-26
21:35
More efficient removal of duplicates in recursive queries using the UNION compound operator. check-in: 06c2db87 user: drh tags: trunk
13:53
In the command-line shell for CSV import, if the lines are \r\n terminated and the last field is blank, make sure an empty string and not a "\r" string is imported. check-in: 9c2e7612 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

   814    814         ExprList *pSO;
   815    815         pSO = pDest->pOrderBy;
   816    816         assert( pSO );
   817    817         nKey = pSO->nExpr;
   818    818         r1 = sqlite3GetTempReg(pParse);
   819    819         r2 = sqlite3GetTempRange(pParse, nKey+2);
   820    820         r3 = r2+nKey+1;
   821         -      sqlite3VdbeAddOp3(v, OP_MakeRecord, regResult, nResultCol, r3);
   822    821         if( eDest==SRT_DistQueue ){
   823    822           /* If the destination is DistQueue, then cursor (iParm+1) is open
   824    823           ** on a second ephemeral index that holds all values every previously
   825         -        ** added to the queue.  Only add this new value if it has never before
   826         -        ** been added */
   827         -        addrTest = sqlite3VdbeAddOp4Int(v, OP_Found, iParm+1, 0, r3, 0);
          824  +        ** added to the queue. */
          825  +        addrTest = sqlite3VdbeAddOp4Int(v, OP_Found, iParm+1, 0, 
          826  +                                        regResult, nResultCol);
   828    827           VdbeCoverage(v);
          828  +      }
          829  +      sqlite3VdbeAddOp3(v, OP_MakeRecord, regResult, nResultCol, r3);
          830  +      if( eDest==SRT_DistQueue ){
   829    831           sqlite3VdbeAddOp2(v, OP_IdxInsert, iParm+1, r3);
   830    832           sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
   831    833         }
   832    834         for(i=0; i<nKey; i++){
   833    835           sqlite3VdbeAddOp2(v, OP_SCopy,
   834    836                             regResult + pSO->a[i].u.x.iOrderByCol - 1,
   835    837                             r2+i);