Re: Joining views disables indexes? - Mailing list pgsql-performance

From Steinar H. Gunderson
Subject Re: Joining views disables indexes?
Date
Msg-id 20051101232816.GA15321@uio.no
Whole thread Raw
In response to Joining views disables indexes?  (Mitch Pirtle <mitch.pirtle@gmail.com>)
List 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 by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Joining views disables indexes?
Next
From: Tom Lane
Date:
Subject: Re: Joining views disables indexes?