/ Check-in [e5342234]
Login

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

Overview
Comment:When TEMP files are in memory, also put the massive TEMP file used by the VACUUM command in memory. This is a cherry-pick merge of [9daf4e7d07]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.6.22
Files: files | file ages | folders
SHA1: e5342234357dcfde33fb7589f87d64f6de7d9970
User & Date: drh 2010-03-03 00:02:58
Context
2010-03-03
22:40
Modify the sqlite3_log() interface and implementation so that it never uses dynamic memory allocation - to avoid deadlocking when called while holding the memory allocator mutex. Cherry-pick merge of [28d1bc98d6]. check-in: 6f368b54 user: drh tags: branch-3.6.22
08:12
Silence a compiler warning by using a constant value instead of a constant expression that some compilers mistakenly believe causes bitshift overflow. check-in: 587109c8 user: dan tags: mistake
00:02
When TEMP files are in memory, also put the massive TEMP file used by the VACUUM command in memory. This is a cherry-pick merge of [9daf4e7d07] check-in: e5342234 user: drh tags: branch-3.6.22
2010-02-25
14:56
Expire pragma statements when reset, even if they were not run to completion. check-in: b8fbf427 user: drh tags: branch-3.6.22
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/pcache.c.

185
186
187
188
189
190
191

192
193
194
195
196
197
198
** are no outstanding page references when this function is called.
*/
void sqlite3PcacheSetPageSize(PCache *pCache, int szPage){
  assert( pCache->nRef==0 && pCache->pDirty==0 );
  if( pCache->pCache ){
    sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache);
    pCache->pCache = 0;

  }
  pCache->szPage = szPage;
}

/*
** Try to obtain a page from the cache.
*/







>







185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
** are no outstanding page references when this function is called.
*/
void sqlite3PcacheSetPageSize(PCache *pCache, int szPage){
  assert( pCache->nRef==0 && pCache->pDirty==0 );
  if( pCache->pCache ){
    sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache);
    pCache->pCache = 0;
    pCache->pPage1 = 0;
  }
  pCache->szPage = szPage;
}

/*
** Try to obtain a page from the cache.
*/

Changes to src/vacuum.c.

134
135
136
137
138
139
140



141

142
143
144
145
146
147
148
  ** (Later:) I tried setting "PRAGMA vacuum_db.journal_mode=OFF" but
  ** that actually made the VACUUM run slower.  Very little journalling
  ** actually occurs when doing a vacuum since the vacuum_db is initially
  ** empty.  Only the journal header is written.  Apparently it takes more
  ** time to parse and run the PRAGMA to turn journalling off than it does
  ** to write the journal header file.
  */



  zSql = "ATTACH '' AS vacuum_db;";

  rc = execSql(db, pzErrMsg, zSql);
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
  pDb = &db->aDb[db->nDb-1];
  assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 );
  pTemp = db->aDb[db->nDb-1].pBt;

  /* The call to execSql() to attach the temp database has left the file







>
>
>
|
>







134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
  ** (Later:) I tried setting "PRAGMA vacuum_db.journal_mode=OFF" but
  ** that actually made the VACUUM run slower.  Very little journalling
  ** actually occurs when doing a vacuum since the vacuum_db is initially
  ** empty.  Only the journal header is written.  Apparently it takes more
  ** time to parse and run the PRAGMA to turn journalling off than it does
  ** to write the journal header file.
  */
  if( sqlite3TempInMemory(db) ){
    zSql = "ATTACH ':memory:' AS vacuum_db;";
  }else{
    zSql = "ATTACH '' AS vacuum_db;";
  }
  rc = execSql(db, pzErrMsg, zSql);
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
  pDb = &db->aDb[db->nDb-1];
  assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 );
  pTemp = db->aDb[db->nDb-1].pBt;

  /* The call to execSql() to attach the temp database has left the file