feature request: Loose index scans

Started by Gregg Lindabout 16 years ago3 messagesbugs
Jump to latest
#1Gregg Lind
gregg.lind@gmail.com

As per http://osdir.com/ml/pgsql-hackers/2010-03/msg00331.html, I would
certainly find it helpful is count(distinct(myfield)) wasn't a full index
scan.

Gregg Lind

#2Robert Haas
robertmhaas@gmail.com
In reply to: Gregg Lind (#1)
Re: feature request: Loose index scans

On Mon, Mar 15, 2010 at 3:04 PM, Gregg Lind <gregg.lind@gmail.com> wrote:

As per http://osdir.com/ml/pgsql-hackers/2010-03/msg00331.html, I would
certainly find it helpful is count(distinct(myfield)) wasn't a full index
scan.

We should maybe add this to our Todo file, if it's not there already
(I don't see it on a quick look).

...Robert

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#2)
Re: feature request: Loose index scans

Robert Haas <robertmhaas@gmail.com> writes:

On Mon, Mar 15, 2010 at 3:04 PM, Gregg Lind <gregg.lind@gmail.com> wrote:

As per http://osdir.com/ml/pgsql-hackers/2010-03/msg00331.html, I would
certainly find it helpful is count(distinct(myfield)) wasn't a full index
scan.

We should maybe add this to our Todo file, if it's not there already
(I don't see it on a quick look).

I think previous discussions of it have been under names like "skip
scan" (I certainly find "loose scan" to be completely useless
terminology, if indeed it even means what the OP wants at all).

However, most of the complaints about this were logged against PG
versions that wouldn't convert DISTINCT queries into hash aggregation.
COUNT(DISTINCT x) still doesn't. Sometime it might be worth trying
to fix that.

regards, tom lane