aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <>2024-08-17 19:46:49 +0000
committerdrh <>2024-08-17 19:46:49 +0000
commit8797bd695f97db094bf10e546170d7b1e266867c (patch)
tree162455af982cbc5af4ce2a075c2de5c3c837d2ce /src/sqliteInt.h
parent21363ac78df6751655c33372a7277512531b9570 (diff)
downloadsqlite-8797bd695f97db094bf10e546170d7b1e266867c.tar.gz
sqlite-8797bd695f97db094bf10e546170d7b1e266867c.zip
Reduce the size of the SrcItem object by combining fields into a union.
FossilOrigin-Name: a4c59ac3c6ec979c25b544d29e47b8e39f6439c098eed8f84b3bd506c9adf047
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index ebd0f01b2..75e1f6120 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -3297,13 +3297,11 @@ struct IdList {
** u2.pCteUse fg.isCte && !fg.isIndexedBy
*/
struct SrcItem {
- Schema *pSchema; /* Schema to which this item is fixed */
- char *zDatabase; /* Name of database holding this table */
char *zName; /* Name of the table */
char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
Table *pTab; /* An SQL table corresponding to zName */
Select *pSelect; /* A SELECT statement used in place of a table name */
- int addrFillSub; /* Address of subroutine to manifest a subquery */
+ int addrFillSub; /* Address of subroutine to initialize a subquery */
int regReturn; /* Register holding return address of addrFillSub */
int regResult; /* Registers holding results of a co-routine */
struct {
@@ -3323,12 +3321,10 @@ struct SrcItem {
unsigned isSynthUsing :1; /* u3.pUsing is synthesized from NATURAL */
unsigned isNestedFrom :1; /* pSelect is a SF_NestedFrom subquery */
unsigned rowidUsed :1; /* The ROWID of this table is referenced */
+ unsigned fixedSchema :1; /* Uses u4.pSchema, not u4.zDatabase */
+ unsigned hadSchema :1; /* Has u4.zDatabase before u4.pSchema */
} fg;
int iCursor; /* The VDBE cursor number used to access this table */
- union {
- Expr *pOn; /* fg.isUsing==0 => The ON clause of a join */
- IdList *pUsing; /* fg.isUsing==1 => The USING clause of a join */
- } u3;
Bitmask colUsed; /* Bit N set if column N used. Details above for N>62 */
union {
char *zIndexedBy; /* Identifier from "INDEXED BY <zIndex>" clause */
@@ -3339,6 +3335,14 @@ struct SrcItem {
Index *pIBIndex; /* Index structure corresponding to u1.zIndexedBy */
CteUse *pCteUse; /* CTE Usage info when fg.isCte is true */
} u2;
+ union {
+ Expr *pOn; /* fg.isUsing==0 => The ON clause of a join */
+ IdList *pUsing; /* fg.isUsing==1 => The USING clause of a join */
+ } u3;
+ union {
+ Schema *pSchema; /* Schema to which this item is fixed */
+ char *zDatabase; /* Name of database holding this table */
+ } u4;
};
/*