From: Jörg Kiegeland <kiegeland@ikv.de>
To: pgsql-performance@postgresql.org
Subject: Evaluating boolean formula: slow performance
Date: Fri, 11 Jan 2008 18:06:03 +0100
Message-ID: <4787A1FB.2050808@ikv.de> (raw)
I have the following problem:
In my table T, there are a fixed number of boolean columns, C1, .., Cn.
Now, a common query is to search in this table for tuples fullfilling an
arbitrary boolean condition (however only using AND and OR), e.g.
SELECT * FROM T WHERE (C1 OR C2) AND (C3 OR C4 AND C5) OR C6
For every boolean column, I created an index, e.g.
CREATE INDEX columnIndexForC2 ON DIM (C2);
Now I did performance tests and got response times for such a query
which are worser than linear response time..
However I also realized that with boolean queries which use only OR or
use only AND, the response time is very fast, i.e. it seems to be
constant, regardless of how many tuples I add to the table.
So my question is: How can I get an acceptable response time for
arbitrary boolean terms?
Thanks
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: kiegeland@ikv.de
Subject: Re: Evaluating boolean formula: slow performance
In-Reply-To: <4787A1FB.2050808@ikv.de>
* 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