Re: [sqlite] A question about performance

2005-03-01 Thread Dan Kennedy
--- Keith Herold <[EMAIL PROTECTED]> wrote: > Hi all; > > I know that nested queries in the FROM and WHERE clauses are compiled > and run just once. Is that true for the nested queries in the SELECT > clause as well? > > For example: > > SELECT firstname AS First, > (SELECT name

Re: [sqlite] A question about performance

2005-03-01 Thread Dan Kennedy
Distuinguish between compiled and executed. Sub-queries as expressions are always compiled exactly once. If the sub-query doesn't contain references to the outer query, it is executed the first time it is needed and the results cached. For example, if I have: CREATE TABLE ab(a, b); CREATE

[sqlite] A question about performance

2005-03-01 Thread Keith Herold
Hi all; I know that nested queries in the FROM and WHERE clauses are compiled and run just once. Is that true for the nested queries in the SELECT clause as well? For example: SELECT firstname AS First, (SELECT name as Last FROM tbl_of_last_names WHE