| От | Robert Creager |
|---|---|
| Тема | Re: Index isn't used during a join. |
| Дата | |
| Msg-id | 20060110081705.221792f9@thunder.logicalchaos.org обсуждение исходный текст |
| Ответ на | Re: Index isn't used during a join. (Michael Fuhr <mike@fuhr.org>) |
| Список | pgsql-performance |
When grilled further on (Mon, 9 Jan 2006 22:58:18 -0700), Michael Fuhr <mike@fuhr.org> confessed: > On Mon, Jan 09, 2006 at 09:23:38PM -0700, Robert Creager wrote: > > I'm working with a query to get more info out with a join. The base > > query works great speed wise because of index usage. When the join is > > tossed in, the index is no longer used, so the query performance tanks. > > The first query you posted returns 285 rows and the second returns > over one million; index usage aside, that difference surely accounts > for a performance penalty. And as is often pointed out, index scans > aren't always faster than sequential scans: the more of a table a > query has to fetch, the more likely a sequential scan will be faster. Thanks for pointing out the obvious that I missed. Too much data in the second query. It's supposed to match (row wise)what was returned from the first query. Just ignore me for now... Thanks, Rob -- 08:15:24 up 3 days, 42 min, 9 users, load average: 2.07, 2.20, 2.25 Linux 2.6.12-12-2 #4 SMP Tue Jan 3 19:56:19 MST 2006
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера