On Wed, Jul 14, 2010 at 09:58:10PM +1000, Anders ??stergaard Jensen wrote: > Hello mailing list, > > I have a performance problem with my postgres 8.4.4 database. The query is > the following: > > SELECT count(*) AS count_all FROM "plan_events" WHERE (f_plan_event_acl(17, > plan_events.id)) > > QUERY PLAN > > ------------------------------------------------------------------------------------------------------------------------ > Aggregate (cost=2859.77..2859.78 rows=1 width=0) (actual > time=4641.720..4641.720 rows=1 loops=1) > -> Seq Scan on plan_events (cost=0.00..2851.44 rows=3331 width=0) > (actual time=32.821..4640.116 rows=2669 loops=1) > Filter: f_plan_event_acl(17, id) > Total runtime: 4641.753 ms > (4 rows) > > > > What can I do to improve the performance?
Have you tried 'select count (1)..."? Reinoud -- __________________________________________________ "Nothing is as subjective as reality" Reinoud van Leeuwen reinou...@n.leeuwen.net http://reinoud.van.leeuwen.net kvk 27320762 __________________________________________________ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql