James Gregurich wrote:
> on that update statement, is the SQL optimizer smart enough to not  
> rerun that select statement for each column in the update's set  
> clause? Is it going to run a single select statement to get <value1>,  
> <value2>, etc.  or is it going to run one for each column in the  
> update statement?
>
>   
James,

No, I don't believe the optimizer is that smart. SQLite will execute 
multiple queries.

If you are concerned that the matches table is large you could add an 
index on the the row1 column of the matches table to speed up the row2 
lookups. The lookups in table2 using the rowid should be very fast, and 
once the page with the required record has been read into the cache the 
subsequent value  lookup queries
should execute very quickly as well.

HTH
Dennis Cote
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to