I code in VB and I think I stay out of altering the C source code.

> just do a single REPLACE command with a SELECT on 2 or more subqueries on
> sub-sets of the tables (more efficient).

Will try that one.

> This stands to reason since you're only doing a single lookup per
> sub-table instead of the 6 lookups per sub-table you did with the 
> UPDATE command.

Maybe, but the speed is actually less as my figure of 5 to 6 times faster
was faulty due to me not noticing the error caused by the > 32 table joins.
I would say it is about 2 to 3 times faster. Still worth it, plus a nicer
looking SQL.

I wonder what the reason was to limit the number of table joins to 32.


RBS


-----Original Message-----
From: Joe Wilson [mailto:[EMAIL PROTECTED] 
Sent: 01 February 2007 00:42
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] Limit statement size?

--- RB Smissaert <[EMAIL PROTECTED]> wrote:
> There is one important problem though that I just discovered.
> Just found out that the maximum number of tables in a join is 32!
> So, with my base table that is only 31 to add.

Let's do some grepping...

  #define BMS  (sizeof(Bitmask)*8)
 ...
  /* The number of tables in the FROM clause is limited by the number of
  ** bits in a Bitmask
  */
  if( pTabList->nSrc>BMS ){
    sqlite3ErrorMsg(pParse, "at most %d tables in a join", BMS);
    return 0;
  }
 ...

You could try changing src/sqliteInt.h:

 -typedef unsigned int Bitmask;
 +typedef u64 Bitmask;

and then recompiling sqlite. If all goes well, you should be able to
join up to 64 tables. Never tried it. It might work, or might not.

Alternatively, you can either perform 2 consecutive REPLACE commands
with half the tables in each update (less efficient), or just do a single 
REPLACE command with a SELECT on 2 or more subqueries on sub-sets of 
the tables (more efficient).

> Actually make that about 5 to 6 times as fast.

This stands to reason since you're only doing a single lookup per
sub-table instead of the 6 lookups per sub-table you did with the 
UPDATE command.



 
____________________________________________________________________________
________
Never Miss an Email
Stay connected with Yahoo! Mail on your mobile.  Get started!
http://mobile.yahoo.com/services?promote=mail

----------------------------------------------------------------------------
-
To unsubscribe, send email to [EMAIL PROTECTED]
----------------------------------------------------------------------------
-




-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to