We don't do it in SQLite but as an example of how large a legitimate SQL statement can be, in a previous project we generated a pseudo-cube from the current database in a single sql statement. Basically we wanted to implement a fast complex search routine where users can choose any fields from any tables and we can filter quickly.
The sql statement was an INSERT statement with several hundred fields and 40+ joined tables (no where clause). Initially it took 30 seconds to run on Sybase ASE but after some optimization (mostly of the OS, not sql) it ran in under a second for typical production data. Of course we removed all indexes during the actual insert operation. If we did the same thing in our current project we'd have 242 fields in the select list and 69 tables in the FROM clause. No where clause or order by. HTH, Sam ------------------------------------------- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED] -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 09, 2007 7:33 PM To: sqlite-users@sqlite.org Subject: [sqlite] Longest "real" SQL statement I'm looking for an upper bound on how big legitimate SQL statements handed to SQLite get to be. I'm not interested in contrived examples. I want to see really big SQL statements that are actually used in real programs. "Big" can be defined in several ways: * Number of bytes of text in the SQL statement. * Number of tokens in the SQL statement * Number of result columns in a SELECT * Number of terms in an expression If you are using really big SQL statements, please tell me about them. I'd like to see the actual SQL text if possible. But if your use is proprietary, please at least tell me how big your query is in bytes or tokens or columns or expression terms. Thanks. -- D. Richard Hipp <[EMAIL PROTECTED]> ---------------------------------------------------------------------------- - To unsubscribe, send email to [EMAIL PROTECTED] ---------------------------------------------------------------------------- - ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------