I'm planning on generating queries for SQLite that will involve many joins on 12 tables that will surpass the 64 table join limit in SQLite. (~250 table joins or possibly more) This will be running on android eventually. The purpose behind this is to have X amount of user defined fields in the result set depending on the report that is being generated.
Unfortunately I'm not a DBA and I do not know of an optimal way to achieve this.
So far I think the options are:
- Use 2 temp tables to juggle the result set while joining the max amount possible. (My previous solution in SQLServer, fairly slow)
- Produce result sets of a few columns and a key to join on and store them in
n
temp tables. (Wheren
is less than 64) Then join all the temp tables on their common key. - Create a single temp table and fill it up one insert or update at a time.
- Don't do a big join, perform many selects instead and fill up some sort of data container.
Is there something else I should consider?