Evaluating boolean formula: slow performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux