Re: seqscan instead of index scan - Mailing list pgsql-performance

From Martin Sarsale
Subject Re: seqscan instead of index scan
Date
Msg-id 1093965277.1680.93.camel@kadaif
Whole thread Raw
In response to Re: seqscan instead of index scan  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
List pgsql-performance
> Using a functional index you can define an index around the way you
> access the data.  There is no faster or better way to do it...this is a
> mathematical truth, not a problem with the planner.  Why not use the
> right tool for the job?  A boolean index is super-efficient both in disk
> space and cache utilization.

Thanks for your constructive criticism, you're absolutely right.

I had to modify your "return" for a "select":

create function rankeable (bigint, bigint) returns boolean as '
        select case when $1 > 0 or $2 > 0 then true else false end;'
language sql immutable;

and it works great.



Attachment

pgsql-performance by date:

Previous
From: Greg Stark
Date:
Subject: Re: Why does a simple query not use an obvious index?
Next
From: Jean-Max Reymond
Date:
Subject: Performance with Intel Compiler