Re: Question on COUNT performance
От | Reinoud van Leeuwen |
---|---|
Тема | Re: Question on COUNT performance |
Дата | |
Msg-id | 20100714123029.GH62243@spoetnik.xs4all.nl обсуждение исходный текст |
Ответ на | Question on COUNT performance (Anders Østergaard Jensen <aj@itersys.dk>) |
Ответы |
Re: Question on COUNT performance
|
Список | pgsql-sql |
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 reinoud.v@n.leeuwen.net http://reinoud.van.leeuwen.net kvk 27320762 __________________________________________________
В списке pgsql-sql по дате отправления: