Re: Query performance question

From: Lukas Ertl <l(dot)ertl(at)univie(dot)ac(dot)at>
To: David Olbersen <dave(at)slickness(dot)org>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Query performance question
Date: 2001-03-28 21:07:26
Message-ID: 20010328230413.M13216-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, 28 Mar 2001, David Olbersen wrote:

> There are two things you should do first:
>
> 1) VACUUM ANALYZE hits;
> 2) VACUUM ANALYZE referrer;

I did that before, too.

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

Ok, VACUUMing the tables didn't increase performance. This is the EXPLAIN
output:

httplog=# EXPLAIN SELECT count(*), url FROM hits, referrer WHERE
referrer.id = referrer_id GROUP BY url ORDER BY count DESC LIMIT 10;
NOTICE: QUERY PLAN:

Sort (cost=912.81..912.81 rows=678 width=20)
-> Aggregate (cost=846.98..880.90 rows=678 width=20)
-> Group (cost=846.98..863.94 rows=6785 width=20)
-> Sort (cost=846.98..846.98 rows=6785 width=20)
-> Hash Join (cost=10.46..415.17 rows=6785 width=20)
-> Seq Scan on hits (cost=0.00..128.85
rows=6785 width=4)
-> Hash (cost=9.57..9.57 rows=357 width=16)
-> Seq Scan on referrer (cost=0.00..9.57
rows=357 width=16)

EXPLAIN

I hope someone can explain this to me :)

Thanks for your quick answer,

regards,
le

--
Lukas Ertl eMail: l(dot)ertl(at)univie(dot)ac(dot)at
WWW-Redaktion Tel.: (+43 1) 4277-14073
Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140
der Universität Wien

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message José Luiz 2001-03-28 22:31:02 Error in the starting of Postgresql
Previous Message David Olbersen 2001-03-28 20:54:39 Re: Query performance question