Re: [SQL] join optimization problem

2003-08-03 Thread Tom Lane
Toby Tremayne <[EMAIL PROTECTED]> writes: > The output of explain analyze is this: >-> Nested Loop (cost=0.00..1657643.30 rows=65807 width=568) > (actual time=539.82..543404.25 rows=1537 loops=1) > Join Filter: ("inner".thread_id = > ("outer".thread_id)::do

Re: [SQL] join optimization problem

2003-08-03 Thread Toby Tremayne
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Rod, thanks for that - I tried it out, fixed the minor typos and it ran at almost the same speed! Any other ideas? cheers, Toby On Friday 01 August 2003 10:33, Rod Taylor wrote: > How about this? It should spit out the same number, but

Re: [SQL] join optimization problem

2003-08-03 Thread Toby Tremayne
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Tom, yes I re-run vacuum analyze every time I muck about with the tables/ indexes. The output of explain analyze is this: Sort (cost=1660930.18..1660946.63 rows=6581 width=568) (actual time=545668.58..545675.05 rows=1537 loops=1) Sort

Re: [SQL] join optimization problem

2003-08-03 Thread Rod Taylor
> thanks for that - I tried it out, fixed the minor typos and it ran at almost > the same speed! Any other ideas? Could you post an explain analyze for both queries? There is always an application change. Add a trigger onto msg that will bump the date and count on msg_sum when a msg is