Tom - Thanks for your help - it's invaluable!
I have now gone back to my original query shown below:
I set EXPLAIN ANALYZE running on it over 12 hours ago and its still
going! (Yesterdays EXPLAIN ANALYZE took tens of minutes)
So I have included just the ouput from EXPLAIN.
SELECT msg_id, from_line, col_date FROM news_messages WHERE msg_id IN(
SELECT msg_id FROM news_msg_id_ng_id_link WHERE ng_id IN(
SELECT ng_id FROM news_ng_genre_link WHERE genre_id in (3,6)
)
)
QUERY PLAN
------------------------------------------------------------------------
--------------------------
Seq Scan on news_messages (cost=0.00..298471193171502.50 rows=1962232
width=90)
Filter: (subplan)
SubPlan
-> Materialize (cost=76054021.22..76054021.22 rows=4027010 width=44)
-> Seq Scan on news_msg_id_ng_id_link (cost=0.00..76054021.22 rows=
4027010 width=44)
Filter: (subplan)
SubPlan
-> Seq Scan on news_ng_genre_link (cost=0.00..18.84 rows=170 width=8)
Filter: ((genre_id = 3) OR (genre_id = 6))
Any suggestions?
Regards,
The ever thankful.