Re: Query optimizing

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sebastian Ritter <ritter(dot)sebastian(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Query optimizing
Date: 2008-11-10 12:03:22
Message-ID: 4918230A.5060306@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Richard Huxton wrote:
> Do you have an index on (id,dt_modified) for manage_followup? Can you
> provide an EXPLAIN ANALYSE for this?

> Hi Richard,
>
> Firstly, thank-you very much for your swift reply. To answer your
> question,
> I had not been using an index on dt_modfied. I have added it now and
> ran explain analyse on the function snippet. I am almost too
> embarrassed
to show
> the result....
>
> QUERY PLAN
[snip]
> Total runtime: 412464.804 ms!!!!

Something wrong here. I've attacked a small script that generates 10,000
issues and 10 follow-ups for each. It then pulls off the most recent
follow-ups for all issues occurring on a given date.

The explain analyse should show both indexes being used and a runtime of
a few milliseconds.

--
Richard Huxton
Archonet Ltd

Attachment Content-Type Size
issues_fups.sql text/x-sql 1.6 KB

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Sebastian Ritter 2008-11-10 12:21:28 Re: Query optimizing
Previous Message Sebastian Ritter 2008-11-10 11:58:02 Re: Query optimizing