Re: Query performance question

From: David Olbersen <dave(at)slickness(dot)org>
To: Lukas Ertl <l(dot)ertl(at)univie(dot)ac(dot)at>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Query performance question
Date: 2001-03-28 20:54:39
Message-ID: Pine.LNX.4.31.0103281252320.10824-100000@bubbles.electricutopia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, 28 Mar 2001, Lukas Ertl wrote:

There are two things you should do first:

1) VACUUM ANALYZE hits;
2) VACUUM ANALYZE referrer;

If it's still running slowly, try EXPLAINing your SELECT to us.

Also, it's been my experience that LIMIT's slow down a query, though I could be
dead wrong.

> SELECT count(*), url FROM hits, referrer WHERE referrer.id = referrer_id
> GROUP BY url ORDER BY count DESC LIMIT 10;
>
> And this query takes almost five seconds to complete, and that seems to me
> quite slow. The database is running on a Duron 700 with 256 MB RAM and
> ATA-66 disks. Operating system is FreeBSD-4.2.
>
> Are there some tuning knobs I could turn?

-- Dave

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Lukas Ertl 2001-03-28 21:07:26 Re: Query performance question
Previous Message Lukas Ertl 2001-03-28 20:23:27 Query performance question