Re: [GENERAL] Index Scanning

2007-01-03 Thread Enrico
On Wed, 03 Jan 2007 12:21:31 + Richard Huxton wrote: > Don't forget to cc the list Ok thanks :) > > If you issue "set enable_seqscan = off" before the query that should > force it to use the indexes first. What does that plan show you? I try and then I post the results. Regards Enrico

Re: [GENERAL] Index Scanning

2007-01-03 Thread Richard Huxton
Don't forget to cc the list Enrico wrote: On Wed, 03 Jan 2007 10:55:03 + Richard Huxton wrote: You're fetching all the rows from both tables - what would an index scan gain you there is a join Yes, there is a join. Between all the rows in tmp_righe_bolle_carico (tr) and all the match

Re: [GENERAL] Index Scanning

2007-01-03 Thread Richard Huxton
Enrico wrote: Hi, I have this query select TB.id_int,TR.codice_art,importo,cod_iva,prezzo,qta as qta from bolle_carico_testata TB inner join tmp_righe_bolle_carico TR on (TB.id_bolla_rem=TR.id_bolla_rem); [snip plan] Can anybody tell me why I have two Seq scans instead of two Ind. scan? And

[GENERAL] Index Scanning

2007-01-03 Thread Enrico
Hi, I have this query select TB.id_int,TR.codice_art,importo,cod_iva,prezzo,qta as qta from bolle_carico_testata TB inner join tmp_righe_bolle_carico TR on (TB.id_bolla_rem=TR.id_bolla_rem); and these are indexes on tables. # \d tmp_righe_bolle_carico Indexes: "tmpidx1" btree (id_bolla_re