Re: Performance With Joins on Large Tables

Поиск
Список
Период
Сортировка
От Joshua Marsh
Тема Re: Performance With Joins on Large Tables
Дата
Msg-id 38242de90609131227q4837d1cekc50bc1a450175bec@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Performance With Joins on Large Tables  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-performance
> Hmm... that sounds bad. I'm sure your system will always choose indexes
> with that value.
>
> Is it overestimating the cost of using indexes or underestimating the
> cost of a seq scan, or both? Maybe explain with the 0.1 setting will
> help?
>
> Regards,
>        Jeff Davis

data=# explain SELECT v.phonedirect, v.editdrop, EXTRACT (EPOCH FROM
v.custdate), EXTRACT (EPOCH FROM s.custdate) FROM view_505 v INNER
JOIN r3s169 s on v.dsiacctno = s.dsiacctno;
                                                QUERY PLAN
-----------------------------------------------------------------------------------------------------------
 Merge Join  (cost=0.00..51808909.26 rows=285230272 width=11)
   Merge Cond: ("outer".dsiacctno = "inner".dsiacctno)
   ->  Index Scan using view_505_dsiacctno on view_505 v
(cost=0.00..12755411.69 rows=112393848 width=20)
   ->  Index Scan using r3s169_dsiacctno on r3s169 s
(cost=0.00..32357747.90 rows=285230272 width=17)
(4 rows)

This is what I wanted, two index scans.  Just to give you an idea of
the difference in time, this plan would allow me to process 100,000
records ever few seconds, while the sequential scan would only
produces 100,000 every 10 minutes.

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

Предыдущее
От: "Joshua Marsh"
Дата:
Сообщение: Re: Query Progress (was: Performance With Joins on Large Tables)
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: sql-bench