On Sun, Mar 13, 2011 at 10:31 AM, Igor Tandetnik wrote:
> Garry Watkins 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
On Sun, 2011-03-13 at 14:53 -0400, Pavel Ivanov wrote:
> On Sun, Mar 13, 2011 at 2:46 PM, Steven Hartland
> 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 SQLITE_ENABLE_UPDATE_DELETE_
http://lmgtfy.com/?q=SQLITE_ENABLE_UPDATE_DELETE_LIMIT+site%3Asqlite.org&l=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
wro
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
Thanks!
I forgot about C array numeration... Sorry for being an arse.
Eugene
2011/3/13 Drake Wilson
> Quoth Eugene N , 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;
Quoth Eugene N , 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 pblah[0]. pblah[1] is
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 = sqlite3_open(".
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.
Tr
Garry Watkins 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.
--
Igor Tandetnik
_
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
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 measuri
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 +
>
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
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 (
14 matches
Mail list logo