Re: subselect logic

2008-06-25 Thread Kip Turk
Awesome, thanks. My first attempt is able to run on the full table in 85 seconds. I'll continue to read up on these queries to see if I can optimize it further. Thanks again. Peter Brawley wrote: Kip, > What can I do to optimize this query? For more efficient alternatives see "Within-gr

Re: subselect logic

2008-06-25 Thread Peter Brawley
Kip, > What can I do to optimize this query? For more efficient alternatives see "Within-group aggregates" at http://www.artfulsoftware.com/queries.php. PB - Kip Turk wrote: I'm having problems optimizing a series of subselects. I have the following sample table: mysql> select * fr

subselect logic

2008-06-25 Thread Kip Turk
I'm having problems optimizing a series of subselects. I have the following sample table: mysql> select * from fake order by msgid, id desc; ++---+-+-+ | id | msgid | nec | dt | ++---+-+-+ | 10 | 1 | 300 | 2008