Hey guys.
I've optimised most of my queries to work effectively, but I have one
which is sometimes causing me problems. It is:
SELECT * FROM multiturnTable WHERE rowid in (SELECT rowid FROM
multiturnTable WHERE player1 ='?' UNION ALL SELECT rowid FROM
multiturnTable WHERE player2 = '?') AND
You don't say how big your database is.
My guess is when you see the server using a lot of RAM (and exactly how are you
measuring this?) that it's flushing its disk cache. If you're on Unix use
vmstat to see what your OS cache is doing.
So...perhaps if you increase SQLite's internal cache it
Not sure why you are using a subselect with a union all.
Try this:
SELECT *
FROM multiturnTable
WHERE (player1 ='?' OR player2 ='?')
AND (complete=0 OR p1SubmitScore=0 OR p2SubmitScore=0)
AND p1Declined=0
AND p2Declined=0
Message: 1
Date: Sun, 13 Mar 2011 11:43:30 +
Hi Michael, thanks for this. My database is 40 megabytes (and growing
slowly) - is that a reasonable cachesize?
On 13/03/2011 13:07, Black, Michael (IS) wrote:
You don't say how big your database is.
My guess is when you see the server using a lot of RAM (and exactly how are
you measuring
On 13 Mar 2011, at 11:43am, Ian Hardingham wrote:
SELECT * FROM multiturnTable WHERE rowid in (SELECT rowid FROM
multiturnTable WHERE player1 ='?' UNION ALL SELECT rowid FROM
multiturnTable WHERE player2 = '?') AND (complete=0 OR p1SubmitScore=0
OR p2SubmitScore=0) AND p1Declined=0 AND
Garry Watkins ga...@dynafocus.com wrote:
Not sure why you are using a subselect with a union all.
SELECT *
FROM multiturnTable
WHERE (player1 ='?' OR player2 ='?')
Because OR prevents SQLite from using an index on either player1 or player2,
and turns the query into full table scan.
--
To paraphase Forrect Gump, reasonable is as reasonable does.
It's computed by cachesize*pagesize
Pagesize is limited to 65536 but I don't know what cachesize is lmited to (docs
don't say).
You can make it abosolutely huge if you have the memory for it. And 40MB
sounds awfully small to me.
Hi
I detected a strange feature of sqlite3. Somebody called it Pointer
Liberation army strike.
uchar* pblah[1];
pblah[0] = (uchar*)malloc(10);
pblah[1] = (uchar*)malloc(10); // notice the order
sqlite3* db;
// this call magically kills pblah[1] by making it 0x0
int ret =
Quoth Eugene N neverov.biks.0...@gmail.com, on 2011-03-13 18:14:49 +0200:
uchar* pblah[1];
pblah[0] = (uchar*)malloc(10);
pblah[1] = (uchar*)malloc(10); // notice the order
sqlite3* db;
Your C code is broken. pblah is an array of 1 element, which is
accessible (among other ways) as
Thanks!
I forgot about C array numeration... Sorry for being an arse.
Eugene
2011/3/13 Drake Wilson dr...@begriffli.ch
Quoth Eugene N neverov.biks.0...@gmail.com, on 2011-03-13 18:14:49
+0200:
uchar* pblah[1];
pblah[0] = (uchar*)malloc(10);
pblah[1] = (uchar*)malloc(10); //
On Sun, Mar 13, 2011 at 06:14:49PM +0200, Eugene N scratched on the wall:
uchar* pblah[1];
pblah[0] = (uchar*)malloc(10);
pblah[1] = (uchar*)malloc(10); // notice the order
Any ideas why?
Because pblah is a *one*-element array.
-j
--
Jay A. Kreibich J A Y @ K R E I B I.C H
http://lmgtfy.com/?q=SQLITE_ENABLE_UPDATE_DELETE_LIMIT+site%3Asqlite.orgl=1
If you look for description of SQLITE_ENABLE_UPDATE_DELETE_LIMIT on
the resulting page you'll see that it's not a bug or oversight, it's a
documented feature.
Pavel
On Sun, Mar 13, 2011 at 2:46 PM, Steven Hartland
On Sun, 2011-03-13 at 14:53 -0400, Pavel Ivanov wrote:
On Sun, Mar 13, 2011 at 2:46 PM, Steven Hartland
steven.hartl...@multiplay.co.uk wrote:
After spending many hours banging my head trying to figure out why
sqlite-jdbc was erroring on a delete with a limit even when compiled
with
On Sun, Mar 13, 2011 at 10:31 AM, Igor Tandetnik itandet...@mvps.org wrote:
Garry Watkins ga...@dynafocus.com wrote:
Not sure why you are using a subselect with a union all.
SELECT *
FROM multiturnTable
WHERE (player1 ='?' OR player2 ='?')
Because OR prevents SQLite from using an index on
14 matches
Mail list logo