Re: [PERFORM] How to improve speed of 3 table join &group (HUGE tables)

2007-10-23 Thread Nis Jørgensen
John Major skrev: > Hello Nis- > > I did reset the defaults before running the explain. This line from your original post: -> Seq Scan on sequence_alignment sa (cost=1.00..110379294.60 rows=467042560 width=4) Is an indication that you didn't (AFAIK enable_seqscan=off works by setting

Re: [PERFORM] How to improve speed of 3 table join &group (HUGE tables)

2007-10-18 Thread ismo . tuononen
Hi, how about: select sf.library_id, fio.clip_type , count(sf.sequence_id) fromsequence_fragment sf, fragment_external_info fio ,(SELECT distinct sequence_id from sequence_alignment) sa where sf.seq_frag_id = fio.sequence_frag_id and sf.sequence_id = sa.sequence_id group by s

Re: [PERFORM] How to improve speed of 3 table join &group (HUGE tables)

2007-10-18 Thread John Major
Hi Hekki- When I turn seq_scan off for the new query: explain select sf.library_id, fio.clip_type , count(sf.sequence_id) fromsequence_fragment sf, fragment_external_info fio where sf.seq_frag_id = fio.sequence_frag_id and sf.sequence_id IN (SELECT sequence_id from sequence_alig

Re: [PERFORM] How to improve speed of 3 table join &group (HUGE tables)

2007-10-18 Thread John Major
Hello Nis- I did reset the defaults before running the explain. Primary keys for the tables. sequence_fragment.seq_frag_id sequence.sequence_id Candidate keys. fragment_external_info.seq_frag_id (FK to sequence_fragment.seq_frag_id) sequence_alignment.sequence_id (FK to sequence_fragment.se

Re: [PERFORM] How to improve speed of 3 table join &group (HUGE tables)

2007-10-18 Thread Heikki Linnakangas
John Major wrote: > ~there are indexes on all of the fields being joined (but not on > library_id or clip_type ). ~Everything has been re-analyzed post index > creation > ~I've tried "set enable_seqscan=off" and set (join_table_order or > something) = 1 Seqscanning and sorting a table is generally

Re: [PERFORM] How to improve speed of 3 table join &group (HUGE tables)

2007-10-18 Thread Nis Jørgensen
John Major skrev: > I am trying to join three quite large tables, and the query is > unbearably slow(meaning I can't get results in more than a day of > processing). > I've tried the basic optimizations I understand, and nothing has > improved the execute speed any help with this would be great

[PERFORM] How to improve speed of 3 table join &group (HUGE tables)

2007-10-18 Thread John Major
I am trying to join three quite large tables, and the query is unbearably slow(meaning I can't get results in more than a day of processing). I've tried the basic optimizations I understand, and nothing has improved the execute speed any help with this would be greatly appreciated The th