Re: Joining views disables indexes?

Поиск
Список
Период
Сортировка
От Steinar H. Gunderson
Тема Re: Joining views disables indexes?
Дата
Msg-id 20051101232816.GA15321@uio.no
обсуждение исходный текст
Ответ на Joining views disables indexes?  (Mitch Pirtle <mitch.pirtle@gmail.com>)
Список pgsql-performance
On Tue, Nov 01, 2005 at 06:16:59PM -0500, Mitch Pirtle wrote:
> I have a client that is testing an internal data platform, and they
> were happy with PostgreSQL until they tried to join views - at that
> time they discovered PostgreSQL was not using the indexes, and the
> queries took 24 hours to execute as a result.
>
> Is this a known issue, or is this possibly a site-specific problem?

This is way too general to give a good solution. In general, PostgreSQL
should have no problem using indexes on joins (in versions before 8.0, there
was a problem using indexes on joins of differing data types, though).
This does of course assume that its statistics are good; I assume you've
doing ANALYZE on the database after loading the database?

What you want to do is to post your table definitions and EXPLAIN ANALYZE
output of a slow query; that could be difficult if it takes 24 hours, though,
so you might try a slightly quicker query for starters.

/* Steinar */
--
Homepage: http://www.sesse.net/

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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Joining views disables indexes?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Joining views disables indexes?