pg.ddx.io pgsql-performance@postgresql.org mailing list archivehelp / color / mirror / Atom feed
Evaluating boolean formula: slow performance 2+ messages / 1 participants [nested] [flat]
* Evaluating boolean formula: slow performance @ 2008-01-11 17:06 Jörg Kiegeland <kiegeland@ikv.de> 0 siblings, 1 reply; 2+ messages in thread From: Jörg Kiegeland @ 2008-01-11 17:06 UTC (permalink / raw) To: pgsql-performance 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 ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Evaluating boolean formula: slow performance @ 2008-01-11 17:42 Jörg Kiegeland <kiegeland@ikv.de> parent: Jörg Kiegeland <kiegeland@ikv.de> 0 siblings, 0 replies; 2+ messages in thread From: Jörg Kiegeland @ 2008-01-11 17:42 UTC (permalink / raw) To: pgsql-performance I have to correct my statement, a query seems to be only linear when using OR. This however is strange since some weeks ago, I could get good response times when using exclusively AND. I will investigate on this.. ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2008-01-11 17:42 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2008-01-11 17:06 Evaluating boolean formula: slow performance Jörg Kiegeland <kiegeland@ikv.de> 2008-01-11 17:42 ` Jörg Kiegeland <kiegeland@ikv.de>
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