Re: [9.2devel] why it doesn't do index scan only? - Mailing list pgsql-general

From Pavel Stehule
Subject Re: [9.2devel] why it doesn't do index scan only?
Date
Msg-id CAFj8pRCbRT_vx8quLiAFPc4MKvMSjUGiXhqnYV8MFHBvYAN+uQ@mail.gmail.com
Whole thread Raw
In response to Re: [9.2devel] why it doesn't do index scan only?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [9.2devel] why it doesn't do index scan only?  (Thom Brown <thom@linux.com>)
List pgsql-general
Hello

2011/10/8 Tom Lane <tgl@sss.pgh.pa.us>:
> hubert depesz lubaczewski <depesz@depesz.com> writes:
>> it is selecting 20 rows out of 30 million. why is it:
>> 1. not using index only scan
>> 2. not using even normal index scan?
>
> It thinks the bitmap scan is cheaper.  Whether that's true or not is not
> very clear, but nobody is claiming that the costing of index-only scans
> is accurate yet.
>

I did a few tests and bitmap scan is faster. Maybe there is a some
issue. In very simple test (and very syntetic test)

create table omega(a int);
insert into omega select (random()*10000)::int from generate_series(1,400000);

select count(*) from omega where a = 100;

and index scan is faster than index only scan. There is lot of
duplicates. When I used a bigger range, a speed of bitmap index, index
only scan and index scan is similar - but index scan was faster
everywhere.

Regards

Pavel Stehule


>                        regards, tom lane
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

pgsql-general by date:

Previous
From: pasman pasmański
Date:
Subject: Re: [9.2devel] why it doesn't do index scan only?
Next
From: Thom Brown
Date:
Subject: Re: [9.2devel] why it doesn't do index scan only?