Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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: issues_fups.sql
Description: text/x-sql (1.6 KB)

In response to

Responses

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group