Re: [sqlite] beginner question
--- Dennis Cote <[EMAIL PROTECTED]> wrote: > Qiang wrote: > > hello, > > > > two questions.. > > > > 1. comparing select one or two columns from one > row > > from a bigger table ( 20,000 - 30,000 rows, 20 > columns > > ). > >with > >select the same column from one row from a > smaller > > table (20,000 - 30,000 rows, 2 columns). does it > make > > much different on performance? if yes, what makes > it? > > > > 2. Comparing select a sequence number first from a > > small table THEN select all rows from another > table > > that have the same sequence number ( hence two > selects > > ) > > with > >join select on this two tables where they have > the > > same sequence number. any difference here? > > > > > Qiang, > > Re 1: It will be slightly faster to get the data > from a table with fewer > columns if the required columns are at the end of > the row since sqlite > has to skip over the unused fields. But unless you > have large fields the > difference will be very small. It is more important > to reduce the number > of rows to scan, or provide an index so sqlite can > locate the correct > row more quickly. > > Re 2: I suspect the join will always be faster since > it essentially does > the same thing but without the overhead of executing > a second statement. > If you only return the columns from the second table > it will give the > same results. > thank you for the answer. the reason i asked because i want to combine few smaller table into one and save the time join all of them. your answer helped me see the the consequence. > HTH > Dennis Cote > Qiang Sponsored Link $200,000 mortgage for $660/ mo - 30/15 yr fixed, reduce debt - http://yahoo.ratemarketplace.com - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] beginner question
hello, two questions.. 1. comparing select one or two columns from one row from a bigger table ( 20,000 - 30,000 rows, 20 columns ). with select the same column from one row from a smaller table (20,000 - 30,000 rows, 2 columns). does it make much different on performance? if yes, what makes it? 2. Comparing select a sequence number first from a small table THEN select all rows from another table that have the same sequence number ( hence two selects ) with join select on this two tables where they have the same sequence number. any difference here? thanks, Qiang Sponsored Link Mortgage rates near 39yr lows. $420k for $1,399/mo. Calculate new payment! www.LowerMyBills.com/lre - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Question about sqlite TEMP table
Hi All, Following is the sqlite CREATE TABLE definition: If the "TEMP" or "TEMPORARY" keyword occurs in between "CREATE" and "TABLE" then the table that is created is only visible to the process that opened the database and is automatically deleted when the database is closed. Any indices created on a temporary table are also temporary. Temporary tables and indices are stored in a separate file distinct from the main database file. If a is specified, then the table is created in the named database. It is an error to specify both a and the TEMP keyword, unless the is "temp". If no database name is specified, and the TEMP keyword is not present, the table is created in the main database. It says that temp table is visible to the process it created, but how about in this same process, I join a temp table with non-temp table?. Since I am having Exception says: "no such table" when I do the join. Please help! Thank you in advance. Mica