Richard,,
I don't know if this helps but here is a stack track while the code
appears to be stuck in a loop...
winRead(sqlite3_file * id=0x04418048, void *
pBuf=0x0487d10c, int amt=1024, __int64 offset=3043618816) Line 27073 +
0x1c bytes C
sqlite3OsRead(sqlite3_file * id=0x04418048, void *
pBuf=0x0487d10c, int amt=1024, __int64 offset=3043618816) Line 11852 +
0x20 bytes C
readDbPage(PgHdr * pPg=0x0487d098) Line 34007 + 0x21
bytes C
sqlite3PagerAcquire(Pager * pPager=0x04417f68, unsigned
int pgno=2972285, PgHdr * * ppPage=0x0012e720, int noContent=0) Line
34403 + 0x9 bytesC
sqlite3BtreeGetPage(BtShared * pBt=0x04417c78, unsigned
int pgno=2972285, MemPage * * ppPage=0x0012e920, int noContent=0) Line
38145 + 0x17 bytesC
getAndInitPage(BtShared * pBt=0x04417c78, unsigned int
pgno=2972285, MemPage * * ppPage=0x0012e920) Line 38211 + 0x13 bytes
C
moveToChild(BtCursor * pCur=0x0482f1c8, unsigned int
newPgno=2972285) Line 40616 + 0x11 bytes C
moveToLeftmost(BtCursor * pCur=0x0482f1c8) Line 40747 +
0xd bytes C
sqlite3BtreeNext(BtCursor * pCur=0x0482f1c8, int *
pRes=0x0012ed98) Line 41151 + 0x9 bytes C
sqlite3BtreeNext(BtCursor * pCur=0x0482f1c8, int *
pRes=0x0012ed98) Line 41141 + 0xd bytes C
sqlite3VdbeExec(Vdbe * p=0x0482f7c8) Line 54960 + 0x1e
bytes C
sqlite3Step(Vdbe * p=0x0482f7c8) Line 49388 + 0x9 bytes
C
sqlite3_step(sqlite3_stmt * pStmt=0x0482f7c8) Line
49449 + 0x9 bytes C
From: drhsql...@gmail.com [mailto:drhsql...@gmail.com] On Behalf Of
Richard Hipp
Sent: Friday, November 12, 2010 1:17 PM
To: David Levinson; sqlite-users@sqlite.org
Subject: Re: SQLITE3 - sqlite3_step bug?
On Fri, Nov 12, 2010 at 1:06 PM, David Levinson dlevin...@worldnow.com
wrote:
I have an 11GB database and when I attempt to query the database for the
max(column) value the code within sqlite3_step() gets stuck in a loop
for hours and hours and never seems to return.
Do you know why this is the case and how it can be resolved? I stepped
into the code and all I see page allocations getting created over and
over and over. I just updated to the latest sqlite3 updates and the
issue continues.
My sense is that this is something related to 64 bit indexes. Could this
be?
If column is not indexed, then SQLite has to loop through all 11GB of
your database file looking for the maximum value. That can take time
(though measured in 10s of seconds, not hours).
What does it say if you prepend EXPLAIN QUERY PLAN to the beginning of
your query?
--
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users