Index Scanning

Поиск
Список
Период
Сортировка
От Enrico
Тема Index Scanning
Дата
Msg-id 20070103124110.1a8b5247.scotty@linuxtime.it
обсуждение исходный текст
Ответы Re: Index Scanning  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
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_rem)

gepv=# \d bolle_carico_testata
    "idxbct4" btree (id_bolla_rem)


My query plan is:

QUERY PLAN

-------------------------------------------------------------------------------------------------------------------------------------
 Hash Join  (cost=7.17..888.67 rows=22420 width=67) (actual time=1.059..118.090 rows=22420 loops=1)
   Hash Cond: (tr.id_bolla_rem = tb.id_bolla_rem)
   ->  Seq Scan on tmp_righe_bolle_carico tr  (cost=0.00..545.20 rows=22420 width=67) (actual time=0.030..32.963
rows=22420loops=1) 
   ->  Hash  (cost=6.54..6.54 rows=254 width=16) (actual time=0.980..0.980 rows=254 loops=1)
         ->  Seq Scan on bolle_carico_testata tb  (cost=0.00..6.54 rows=254 width=16) (actual time=0.025..0.500
rows=254loops=1) 
 Total runtime: 141.864 ms
(6 rows)

Can anybody tell me why I have two Seq scans instead of two Ind. scan?
And how can I do to have two ind. scan?

Thanks in advantage.

Enrico

--
If Bill Gates had a penny for everytime Windows crashed,he'd be a multi-billionaire by now .......oh look, he already
is!!!! 
scotty@linuxtime.it - Skype:sscotty71
http://www.linuxtime.it/enricopirozzi

В списке pgsql-general по дате отправления:

Предыдущее
От: "Gregory S. Williamson"
Дата:
Сообщение: Re: queueing via database table?
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Index Scanning