Okay, I can see that.  Here's the theory question:  if SQLite does not
allow inner queries to reference outer queries, than the inner query
ought to need to be run just once.  Why rerun for each row in the
outer case?

I'll have to look at writing these as a join; it may be possible.

--Keith


On Mon, 17 Jan 2005 09:30:40 -0800 (PST), Jay <[EMAIL PROTECTED]> wrote:
> 
> I believe it reevaluates the subquery for each row of the outer
> query (i.e. Yuk!). If you can write your query as a join, or temp
> tables, it's much better. The commercial sql engines behave this way
> too.
> 
> --- Keith Herold <[EMAIL PROTECTED]> wrote:
> 
> > Hi all; I was playing about with some (probably stupid) queries the
> > other day, and I noticed that the performance on queries with nested
> > subqueries was *much* slower, than the same queries with the nested
> > subqueries represented by temporary tables (win32, 2.8.15).  Has
> > anyone else noticed this?  Why would that be true?  I sorta expected
> > that a nested query would be in an intermediate (hidden) temp table
> > anyway, so that they would behave at the same speed, but such is not
> > the case.
> >
> > It doens't matter, in the sense that I will happily create and drop
> > the temp tables involved, but it did make me wonder.
> >
> > Involved is an outer query which contains an inner query, which also
> > contains another inner query.
> >
> > -- Keith
> > ******************************************************
> > - Ever notice how 'big' isn't, compared to 'small'?
> >
> > - Sounds like a Wookie; acts like mad cow.
> >
> > - I'm not a professional; I just get paid to do this.
> >
> > - Rules for programming:
> >    1.  Get it working, right?
> >    2.  Get it working right.
> >
> > - Things I've learned about multithreaded programming:
> >
> >     123...   PPArrvooottieedcc ttm  ueelvvteeirrtyyhtt
> > rhheiianndgge  dwi hnpi rctohhg eri aslm omscitanalgt
> >  iowcbh,je engceltvo ebwrah lip,co hso srci abonlt ehb
> > .ee^Nr waicscee snsoetd  'aotb jtehcet -slaomcea lt'il
> > m^Ne from two or more threads
> > ******************************************************
> >
> 
> 
> =====
> 
> ---------------------------------
> 
> "Lord Tarlington gazed upon the crazed Egyptian hieroglyphics on the walls of 
> the ancient tomb of the petrified pharaoh, he vowed there would be no curse 
> on him like on that other Lord, unless you count his marriage to Lady 
> Tarlington who, when the lost treasure was found, will be dumped faster than 
> that basket in the bulrushes."
>   Melissa Rhodes
> ---------------------------------
> 
> The Castles of Dereth Calendar: a tour of the art and architecture of 
> Asheron's Call
> http://www.lulu.com/content/77264
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Find what you need with new enhanced search.
> http://info.mail.yahoo.com/mail_250
> 


-- 
******************************************************
- Ever notice how 'big' isn't, compared to 'small'?

- Sounds like a Wookie; acts like mad cow.

- I'm not a professional; I just get paid to do this.

- Rules for programming:
   1.  Get it working, right?
   2.  Get it working right.

- Things I've learned about multithreaded programming:

    123...   PPArrvooottieedcc ttm  ueelvvteeirrtyyhtt
rhheiianndgge  dwi hnpi rctohhg eri aslm omscitanalgt 
 iowcbh,je engceltvo ebwrah lip,co hso srci abonlt ehb
.ee^Nr waicscee snsoetd  'aotb jtehcet -slaomcea lt'il
m^Ne from two or more threads
******************************************************

Reply via email to