1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Reduce the amount of heap required to store many schemas by storing each

column datatype appended to the column name, rather than as a separate
allocation.

FossilOrigin-Name: 842b21162713bb141b845b01c136457a31af4ab0
This commit is contained in:
drh
2016-02-29 15:53:11 +00:00
parent 743606c3d3
commit 94eaafa9ce
10 changed files with 52 additions and 37 deletions

View File

@@ -1429,8 +1429,8 @@ static const char *columnTypeImpl(
zType = "INTEGER";
zOrigCol = "rowid";
}else{
zType = pTab->aCol[iCol].zType;
zOrigCol = pTab->aCol[iCol].zName;
zType = sqlite3StrNext(zOrigCol);
estWidth = pTab->aCol[iCol].szEst;
}
zOrigTab = pTab->zName;
@@ -1442,7 +1442,7 @@ static const char *columnTypeImpl(
if( iCol<0 ){
zType = "INTEGER";
}else{
zType = pTab->aCol[iCol].zType;
zType = sqlite3StrNext(pTab->aCol[iCol].zName);
estWidth = pTab->aCol[iCol].szEst;
}
#endif
@@ -1727,10 +1727,7 @@ static void selectAddColumnTypeAndCollation(
a = pSelect->pEList->a;
for(i=0, pCol=pTab->aCol; i<pTab->nCol; i++, pCol++){
p = a[i].pExpr;
if( pCol->zType==0 ){
pCol->zType = sqlite3DbStrDup(db,
columnType(&sNC, p,0,0,0, &pCol->szEst));
}
columnType(&sNC, p, 0, 0, 0, &pCol->szEst);
szAll += pCol->szEst;
pCol->affinity = sqlite3ExprAffinity(p);
if( pCol->affinity==0 ) pCol->affinity = SQLITE_AFF_BLOB;