/ Check-in [5a690486]
Login

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

Overview
Comment:Disable external merge source when SQLITE_TEMP_STORE==3. Add documentation to the OP_OpenSorter opcode.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5a690486811379cea40c6ed48b2902f421234832
User & Date: drh 2011-08-25 18:01:28
Context
2011-08-25
18:54
Fix harmless compiler warnings in test code. No changes to the core. check-in: 16f83fec user: drh tags: trunk
18:01
Disable external merge source when SQLITE_TEMP_STORE==3. Add documentation to the OP_OpenSorter opcode. check-in: 5a690486 user: drh tags: trunk
13:46
Fix the SQLITE_DISABLE_DIRSYNC compile time option. check-in: 6deb3ea1 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqliteInt.h.

   362    362   ** Provide a default value for SQLITE_TEMP_STORE in case it is not specified
   363    363   ** on the command-line
   364    364   */
   365    365   #ifndef SQLITE_TEMP_STORE
   366    366   # define SQLITE_TEMP_STORE 1
   367    367   #endif
   368    368   
          369  +/*
          370  +** If all temporary storage is in-memory, then omit the external merge-sort
          371  +** logic since it is superfluous.
          372  +*/
          373  +#if SQLITE_TEMP_STORE==3 && !defined(SQLITE_OMIT_MERGE_SORT)
          374  +# define SQLITE_OMIT_MERGE_SORT
          375  +#endif
          376  +
   369    377   /*
   370    378   ** GCC does not define the offsetof() macro so we'll have to do it
   371    379   ** ourselves.
   372    380   */
   373    381   #ifndef offsetof
   374    382   #define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
   375    383   #endif

Changes to src/vdbe.c.

  3152   3152   /* Opcode: OpenAutoindex P1 P2 * P4 *
  3153   3153   **
  3154   3154   ** This opcode works the same as OP_OpenEphemeral.  It has a
  3155   3155   ** different name to distinguish its use.  Tables created using
  3156   3156   ** by this opcode will be used for automatically created transient
  3157   3157   ** indices in joins.
  3158   3158   */
         3159  +/* Opcode: OpenSorter P1 P2 * P4 *
         3160  +**
         3161  +** This opcode works like OP_OpenEphemeral except that it opens
         3162  +** a transient index that is specifically designed to sort large
         3163  +** tables using an external merge-sort algorithm.
         3164  +*/
  3159   3165   case OP_OpenSorter: 
  3160   3166   case OP_OpenAutoindex: 
  3161   3167   case OP_OpenEphemeral: {
  3162   3168     VdbeCursor *pCx;
  3163   3169     static const int vfsFlags = 
  3164   3170         SQLITE_OPEN_READWRITE |
  3165   3171         SQLITE_OPEN_CREATE |