From: Martin Sarsale <martin@emepe3.net>
To: Merlin Moncure <merlin.moncure@rcsonline.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: seqscan instead of index scan
Date: Tue, 31 Aug 2004 12:14:37 -0300
Message-ID: <1093965277.1680.93.camel@kadaif> (raw)
In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB3412A748E@Herge.rcsinc.local>
References: <6EE64EF3AB31D5448D0007DD34EEB3412A748E@Herge.rcsinc.local>
> 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.
Attachments:
signature.asc (application/pgp-signature, 188B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: martin@emepe3.net, merlin.moncure@rcsonline.com
Subject: Re: seqscan instead of index scan
In-Reply-To: <1093965277.1680.93.camel@kadaif>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox