On 26/07/10 12:58, Oleg Bartunov wrote:
> Jan,
>
> On Sun, 25 Jul 2010, Jan Urbaski wrote:
>
>> On 02/07/10 14:33, Teodor Sigaev wrote:
>>> Patch implements much more accuracy estimation of cost for GIN index
>>> scan than generic cost estimation function.
>> I was able to reproduce his issue, that is: select id from ftstest where
>> body_fts @@ to_tsquery('commonterm80'); was choosing a sequential scan,
>> which was resulting in much longer execution than the bitmap index plan
>> that I got after disabling seqscans.
>>
>> I then applied the patch, recompiled PG and tried again... and nothing
>> changed. I first tried running ANALYSE and then dropping and recreating
>> the GIN index, but the planner still chooses the seq scan.
>
> read thread
> http://archives.postgresql.org/pgsql-hackers/2010-04/msg01407.php
> There is always a fuzz factor, as Tom said, about 1% in path cost
> comparisons.
> You may compare plans for 'commonterm60', 'commonterm40'.
OK, I thought this might be the case, as with the patch the sequential
scan is
winning only be a small margin.
Thanks,
Jan