Re: slow count in window query

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: slow count in window query
Date: 2009-07-16 11:07:03
Message-ID: 162867790907160407u6bb86ac4n5e4bfacd674a8234@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I'm also not sure how to handle this if the set has to be spooled to
> disk. Quicksort and Quickselect do a lot of scans throught he data and
> wouldn't perform well on disk.

I thing, so problem is in aggregate func used as window func - or some
missing optimalisation.

when I replaced count(*) over () by subselect (SELECT count(*) FROM
...) then I got expected speed.

Pavel

>
> --
> greg
> http://mit.edu/~gsstark/resume.pdf
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bernd Helmle 2009-07-16 11:52:59 Re: boolean in C
Previous Message Greg Stark 2009-07-16 11:02:39 Re: slow count in window query