From: | Josh Berkus <josh(at)agliodbs(dot)com> |
---|---|
To: | Oleg Lebedev <oleg(dot)lebedev(at)waterford(dot)org>, "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com> |
Cc: | "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: TPC-R benchmarks |
Date: | 2003-10-03 05:27:08 |
Message-ID: | 200310022227.08554.josh@agliodbs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Oleg,
> I have another question. How do I optimize my indexes for the query that
> contains a lot of ORed blocks, each of which contains a bunch of ANDed
> expressions? The structure of each ORed block is the same except the
> right-hand-side values vary.
Given the example, I'd do a multicolumn index on p_brand, p_container, p_size
and a second multicolumn index on l_partkey, l_quantity, l_shipmode. Hmmm
... or maybe seperate indexes, one on l_partkey and one on l_quantity,
l_shipmode & l_instruct. Test both configurations.
Mind you, if this is also an OLTP table, then you'd want to test those
multi-column indexes to determine the least columns you need for the indexes
still to be used, since more columns = more index maintainence.
--
Josh Berkus
Aglio Database Solutions
San Francisco
From | Date | Subject | |
---|---|---|---|
Next Message | Tomasz Myrta | 2003-10-03 05:59:25 | Re: Is This My Speed Limit? |
Previous Message | Greg Stark | 2003-10-03 05:13:08 | Re: count(*) slow on large tables |