/ Check-in [1cb9aedf]
Login

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

Overview
Comment:Reduce the size of the Table object by 16 bytes on 64-bit machines, mostly by avoiding intermixing pointer fields with integer fields.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1cb9aedfcf81f0086fa741cb29a062ee87724a5e
User & Date: drh 2012-09-13 14:42:43
Context
2012-09-13
15:24
Improved reporting of filename translation errors in the Windows VFS. check-in: eb0f1c29 user: mistachkin tags: trunk
14:42
Reduce the size of the Table object by 16 bytes on 64-bit machines, mostly by avoiding intermixing pointer fields with integer fields. check-in: 1cb9aedf user: drh tags: trunk
14:22
Change boolean fields in the Column object from unsigned characters into bits in a single bit mask variable. check-in: 4163f5f1 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

  1242   1242   **
  1243   1243   ** Return SQLITE_OK on success.  If a memory allocation error occurs,
  1244   1244   ** store NULL in *paCol and 0 in *pnCol and return SQLITE_NOMEM.
  1245   1245   */
  1246   1246   static int selectColumnsFromExprList(
  1247   1247     Parse *pParse,          /* Parsing context */
  1248   1248     ExprList *pEList,       /* Expr list from which to derive column names */
  1249         -  int *pnCol,             /* Write the number of columns here */
         1249  +  i16 *pnCol,             /* Write the number of columns here */
  1250   1250     Column **paCol          /* Write the new column list here */
  1251   1251   ){
  1252   1252     sqlite3 *db = pParse->db;   /* Database connection */
  1253   1253     int i, j;                   /* Loop counters */
  1254   1254     int cnt;                    /* Index added to make the name unique */
  1255   1255     Column *aCol, *pCol;        /* For looping over result columns */
  1256   1256     int nCol;                   /* Number of columns in the result set */

Changes to src/sqliteInt.h.

  1283   1283   ** refers VDBE cursor number that holds the table open, not to the root
  1284   1284   ** page number.  Transient tables are used to hold the results of a
  1285   1285   ** sub-query that appears instead of a real table name in the FROM clause 
  1286   1286   ** of a SELECT statement.
  1287   1287   */
  1288   1288   struct Table {
  1289   1289     char *zName;         /* Name of the table or view */
  1290         -  int iPKey;           /* If not negative, use aCol[iPKey] as the primary key */
  1291         -  int nCol;            /* Number of columns in this table */
  1292   1290     Column *aCol;        /* Information about each column */
  1293   1291     Index *pIndex;       /* List of SQL indexes on this table. */
  1294         -  int tnum;            /* Root BTree node for this table (see note above) */
  1295         -  tRowcnt nRowEst;     /* Estimated rows in table - from sqlite_stat1 table */
  1296   1292     Select *pSelect;     /* NULL for tables.  Points to definition if a view. */
  1297         -  u16 nRef;            /* Number of pointers to this Table */
  1298         -  u8 tabFlags;         /* Mask of TF_* values */
  1299         -  u8 keyConf;          /* What to do in case of uniqueness conflict on iPKey */
  1300   1293     FKey *pFKey;         /* Linked list of all foreign keys in this table */
  1301   1294     char *zColAff;       /* String defining the affinity of each column */
  1302   1295   #ifndef SQLITE_OMIT_CHECK
  1303   1296     ExprList *pCheck;    /* All CHECK constraints */
  1304   1297   #endif
         1298  +  tRowcnt nRowEst;     /* Estimated rows in table - from sqlite_stat1 table */
         1299  +  int tnum;            /* Root BTree node for this table (see note above) */
         1300  +  i16 iPKey;           /* If not negative, use aCol[iPKey] as the primary key */
         1301  +  i16 nCol;            /* Number of columns in this table */
         1302  +  u16 nRef;            /* Number of pointers to this Table */
         1303  +  u8 tabFlags;         /* Mask of TF_* values */
         1304  +  u8 keyConf;          /* What to do in case of uniqueness conflict on iPKey */
  1305   1305   #ifndef SQLITE_OMIT_ALTERTABLE
  1306   1306     int addColOffset;    /* Offset in CREATE TABLE stmt to add a new column */
  1307   1307   #endif
  1308   1308   #ifndef SQLITE_OMIT_VIRTUALTABLE
  1309         -  VTable *pVTable;     /* List of VTable objects. */
  1310   1309     int nModuleArg;      /* Number of arguments to the module */
  1311   1310     char **azModuleArg;  /* Text of all module args. [0] is module name */
         1311  +  VTable *pVTable;     /* List of VTable objects. */
  1312   1312   #endif
  1313   1313     Trigger *pTrigger;   /* List of triggers stored in pSchema */
  1314   1314     Schema *pSchema;     /* Schema that contains this table */
  1315   1315     Table *pNextZombie;  /* Next on the Parse.pZombieTab list */
  1316   1316   };
  1317   1317   
  1318   1318   /*