Skip site navigation (1) Skip section navigation (2)

Re: seqscan instead of index scan

From: Martin Sarsale <martin(at)emepe3(dot)net>
To: Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: seqscan instead of index scan
Date: 2004-08-31 15:14:37
Message-ID: 1093965277.1680.93.camel@kadaif (view raw, whole thread or download thread mbox)
Lists: 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.

In response to

pgsql-performance by date

Next:From: Jean-Max ReymondDate: 2004-08-31 15:27:41
Subject: Performance with Intel Compiler
Previous:From: Greg StarkDate: 2004-08-31 06:00:22
Subject: Re: Why does a simple query not use an obvious index?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group