Re: [PERFORM] encourging bitmap AND

2011-01-02 Thread Jim Nasby
On Dec 26, 2010, at 11:24 AM, Tom Lane wrote: > If you're doing interval queries enough to worry about having an index > for them, you really want an indexing structure that is designed to do > interval queries efficiently. BTW, one way to accomplish that is to transform your data into geometric s

Re: [PERFORM] encourging bitmap AND

2010-12-26 Thread Tom Lane
Marti Raudsepp writes: > On Thu, Dec 23, 2010 at 22:52, Tom Lane wrote: >> That index structure is really entirely unsuited to what you want to do, >> so it's not surprising that the planner isn't impressed with the idea of >> a bitmap AND. > Why is it unsuited for this query? It expands to (150

Re: [PERFORM] encourging bitmap AND

2010-12-25 Thread Marti Raudsepp
On Thu, Dec 23, 2010 at 22:52, Tom Lane wrote: > Ben writes: >> i have a schema similar to the following > >> create index foo_s_idx on foo using btree (s); >> create index foo_e_idx on foo using btree (e); > >> i want to do queries like > >> select * from foo where 150 between s and e; > > That

Re: [PERFORM] encourging bitmap AND

2010-12-23 Thread Ben
On Dec 23, 2010, at 12:52 PM, Tom Lane wrote: > Ben writes: >> i have a schema similar to the following > >> create index foo_s_idx on foo using btree (s); >> create index foo_e_idx on foo using btree (e); > >> i want to do queries like > >> select * from foo where 150 between s and e; > > T

Re: [PERFORM] encourging bitmap AND

2010-12-23 Thread Tom Lane
Ben writes: > i have a schema similar to the following > create index foo_s_idx on foo using btree (s); > create index foo_e_idx on foo using btree (e); > i want to do queries like > select * from foo where 150 between s and e; That index structure is really entirely unsuited to what you want

[PERFORM] encourging bitmap AND

2010-12-23 Thread Ben
hello -- i have a schema similar to the following create table foo ( id integer not null, val integer not null, s integer not null, e integer not null ); create index foo_s_idx on foo using btree (s); create index foo_e_idx on foo using btree (e); i want to do queries like select * from fo