Query Plan - Index Scan & Seq Scan

Поиск
Список
Период
Сортировка
От Prasanth
Тема Query Plan - Index Scan & Seq Scan
Дата
Msg-id 428370AC.3070207@nqadmin.com
обсуждение исходный текст
Ответы Re: Query Plan - Index Scan & Seq Scan
Re: Query Plan - Index Scan & Seq Scan
Список pgsql-admin
When joining two tables the query plan is doing a seq scan rather than index
scan. I do have indexes on the columns used for joining the tables.

Example:
SELECT a.id FROM a, b WHERE a.id = b.id;

                                       QUERY PLAN
-----------------------------------------------------------------------------------------
 Hash Join  (cost=13865.30..326413.23 rows=6451 width=18)
   Hash Cond: ("outer".id = "inner".id)
   ->  Seq Scan on a  (cost=0.00..125076.37 rows=6450937 width=18)
   ->  Hash  (cost=10168.64..10168.64 rows=500664 width=4)
         ->  Seq Scan on b (cost=0.00..10168.64 rows=500664 width=4)
(5 rows)


The planner used to perform a index scan. I have added a lot of data in those
two tables. Right now both tables have millions of records. After adding the new
records the planner is going for a seq scan while doing the join.

Is there any tunning I can do so that the query planner would do a index scan?

I did a vacuum analyze but no change.

Thanks,
-Prasanth.

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: brute force attacking the password
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: how do i kill user sessions?