/ Check-in [3e1a3f68]
Login

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

Overview
Comment:Rearrange fields in the Parse object for a tighter packing, resulting in an 8% size reduction on x64.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3e1a3f68d7457ff708222a3448404b593f018fc2
User & Date: drh 2014-02-04 15:55:25
Context
2014-02-04
20:46
Remove the SF_Materialize flag from the SELECT object as it does not accomplish anything useful. check-in: 65d5dcdd user: drh tags: trunk
15:55
Rearrange fields in the Parse object for a tighter packing, resulting in an 8% size reduction on x64. check-in: 3e1a3f68 user: drh tags: trunk
2014-02-03
17:04
Performance optimizations in sqlite3PcacheFetch(). check-in: b60cc11e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqliteInt.h.

  2354   2354     int iRangeReg;       /* First register in temporary register block */
  2355   2355     int nErr;            /* Number of errors seen */
  2356   2356     int nTab;            /* Number of previously allocated VDBE cursors */
  2357   2357     int nMem;            /* Number of memory cells used so far */
  2358   2358     int nSet;            /* Number of sets used so far */
  2359   2359     int nOnce;           /* Number of OP_Once instructions so far */
  2360   2360     int nOpAlloc;        /* Number of slots allocated for Vdbe.aOp[] */
  2361         -  int nLabel;          /* Number of labels used */
  2362         -  int *aLabel;         /* Space to hold the labels */
  2363   2361     int iFixedOp;        /* Never back out opcodes iFixedOp-1 or earlier */
  2364   2362     int ckBase;          /* Base register of data during check constraints */
  2365   2363     int iPartIdxTab;     /* Table corresponding to a partial index */
  2366   2364     int iCacheLevel;     /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
  2367   2365     int iCacheCnt;       /* Counter used to generate aColCache[].lru values */
         2366  +  int nLabel;          /* Number of labels used */
         2367  +  int *aLabel;         /* Space to hold the labels */
  2368   2368     struct yColCache {
  2369   2369       int iTable;           /* Table cursor number */
  2370         -    int iColumn;          /* Table column number */
         2370  +    i16 iColumn;          /* Table column number */
  2371   2371       u8 tempReg;           /* iReg is a temp register that needs to be freed */
  2372   2372       int iLevel;           /* Nesting level */
  2373   2373       int iReg;             /* Reg with value of this column. 0 means none. */
  2374   2374       int lru;              /* Least recently used entry has the smallest value */
  2375   2375     } aColCache[SQLITE_N_COLCACHE];  /* One for each column cache entry */
  2376   2376     ExprList *pConstExpr;/* Constant expressions */
         2377  +  Token constraintName;/* Name of the constraint currently being parsed */
  2377   2378     yDbMask writeMask;   /* Start a write transaction on these databases */
  2378   2379     yDbMask cookieMask;  /* Bitmask of schema verified databases */
  2379   2380     int cookieGoto;      /* Address of OP_Goto to cookie verifier subroutine */
  2380   2381     int cookieValue[SQLITE_MAX_ATTACHED+2];  /* Values of cookies to verify */
  2381   2382     int regRowid;        /* Register holding rowid of CREATE TABLE entry */
  2382   2383     int regRoot;         /* Register holding root page number for new objects */
  2383   2384     int nMaxArg;         /* Max args passed to user function by sub-program */
  2384         -  Token constraintName;/* Name of the constraint currently being parsed */
  2385   2385   #ifndef SQLITE_OMIT_SHARED_CACHE
  2386   2386     int nTableLock;        /* Number of locks in aTableLock */
  2387   2387     TableLock *aTableLock; /* Required table locks for shared-cache mode */
  2388   2388   #endif
  2389   2389     AutoincInfo *pAinc;  /* Information about AUTOINCREMENT counters */
  2390   2390   
  2391   2391     /* Information used while coding trigger programs. */
................................................................................
  2396   2396     u32 nQueryLoop;      /* Est number of iterations of a query (10*log2(N)) */
  2397   2397     u32 oldmask;         /* Mask of old.* columns referenced */
  2398   2398     u32 newmask;         /* Mask of new.* columns referenced */
  2399   2399     u8 eTriggerOp;       /* TK_UPDATE, TK_INSERT or TK_DELETE */
  2400   2400     u8 eOrconf;          /* Default ON CONFLICT policy for trigger steps */
  2401   2401     u8 disableTriggers;  /* True to disable triggers */
  2402   2402   
  2403         -  /* Above is constant between recursions.  Below is reset before and after
  2404         -  ** each recursion */
         2403  +  /************************************************************************
         2404  +  ** Above is constant between recursions.  Below is reset before and after
         2405  +  ** each recursion.  The boundary between these two regions is determined
         2406  +  ** using offsetof(Parse,nVar) so the nVar field must be the first field
         2407  +  ** in the recursive region.
         2408  +  ************************************************************************/
  2405   2409   
  2406   2410     int nVar;                 /* Number of '?' variables seen in the SQL so far */
  2407   2411     int nzVar;                /* Number of available slots in azVar[] */
  2408   2412     u8 iPkSortOrder;          /* ASC or DESC for INTEGER PRIMARY KEY */
         2413  +  u8 bFreeWith;             /* True if pWith should be freed with parser */
  2409   2414     u8 explain;               /* True if the EXPLAIN flag is found on the query */
  2410   2415   #ifndef SQLITE_OMIT_VIRTUALTABLE
  2411   2416     u8 declareVtab;           /* True if inside sqlite3_declare_vtab() */
  2412   2417     int nVtabLock;            /* Number of virtual tables to lock */
  2413   2418   #endif
  2414   2419     int nAlias;               /* Number of aliased result set columns */
  2415   2420     int nHeight;              /* Expression tree height of current sub-select */
................................................................................
  2428   2433   #ifndef SQLITE_OMIT_VIRTUALTABLE
  2429   2434     Token sArg;               /* Complete text of a module argument */
  2430   2435     Table **apVtabLock;       /* Pointer to virtual tables needing locking */
  2431   2436   #endif
  2432   2437     Table *pZombieTab;        /* List of Table objects to delete after code gen */
  2433   2438     TriggerPrg *pTriggerPrg;  /* Linked list of coded triggers */
  2434   2439     With *pWith;              /* Current WITH clause, or NULL */
  2435         -  u8 bFreeWith;             /* True if pWith should be freed with parser */
  2436   2440   };
  2437   2441   
  2438   2442   /*
  2439   2443   ** Return true if currently inside an sqlite3_declare_vtab() call.
  2440   2444   */
  2441   2445   #ifdef SQLITE_OMIT_VIRTUALTABLE
  2442   2446     #define IN_DECLARE_VTAB 0