Re: very slow selects on a small table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brian Cox <brian(dot)cox(at)ca(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: very slow selects on a small table
Date: 2009-06-18 17:48:03
Message-ID: 12345.1245347283@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Brian Cox <brian(dot)cox(at)ca(dot)com> writes:
> these queries are still running now 27.5 hours later... These queries
> are generated by some java code and in putting it into a test program so
> I could capture the queries, I failed to get the id range correct --
> sorry for wasting your time with bogus data. Below is the EXPLAIN output
> from the 4 correct queries. I can't tell which one is being executed by
> PID 7397, but the query plans, except the last, do look very similar. In
> any event, as I mentioned, all 4 are still running.

Strange as can be. Can you do an EXPLAIN ANALYZE on just the IN's
sub-select and confirm that the runtime of that is reasonable? I'd
be interested to know how many rows it really returns, too.

One thing that strikes me is that the cost estimates seem a bit on the
low side for the rowcounts. Are you using nondefault planner cost
parameters, and if so what?

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Peter Alban 2009-06-18 18:27:02 Strange performance response for high load times
Previous Message Grzegorz Jaśkiewicz 2009-06-18 17:21:03 Re: very slow selects on a small table