On Wed, Oct 05, 2005 at 11:13:58AM +0200, [EMAIL PROTECTED] wrote:
> On Tuesday 04 October 2005 23:08, Michael Fuhr wrote:
> > On Tue, Oct 04, 2005 at 09:32:41PM +0200, [EMAIL PROTECTED] wrote:
> > > I've got a table with an index, let's call it fase.
> > >
> > > The following query is fine: 'selec
[EMAIL PROTECTED] writes:
> PS We still have to be careful how to formulate conditions:
>
> where fase in ('1','2')
>
> is ok, and uses the index, but the logically identical:
>
> where position(fase in '12') >= 1
>
> does a sequential scan.
Right, you would need a functional index to fix that.
On Tuesday 04 October 2005 23:08, Michael Fuhr wrote:
> On Tue, Oct 04, 2005 at 09:32:41PM +0200, [EMAIL PROTECTED] wrote:
> > I've got a table with an index, let's call it fase.
> >
> > The following query is fine: 'select something from table where fase =
> > '1';
> >
> > However, this is disast
On Tuesday 04 October 2005 22:26, [EMAIL PROTECTED] wrote:
> Just a guess but have you tried using an in clause?
>
> select something from table where fase in ('1' , '2');
>
Not surprisingly, this also does a sequential scan on the table. (It would be
_very_ diffcult to see that this is a union,
On Tue, Oct 04, 2005 at 09:32:41PM +0200, [EMAIL PROTECTED] wrote:
> I've got a table with an index, let's call it fase.
>
> The following query is fine: 'select something from table where fase = '1';
>
> However, this is disastrously slow:
> select something from table where fase = '1' or fase
Just a guess but have you tried using an in clause?
select something from table where fase in ('1' , '2');
On Tuesday 04 October 2005 13:32, [EMAIL PROTECTED] wrote:
> Hello
>
> I've got a table with an index, let's call it fase.
>
> The following query is fine: 'select something from table w
Hello
I've got a table with an index, let's call it fase.
The following query is fine: 'select something from table where fase = '1';
However, this is disastrously slow:
select something from table where fase = '1' or fase = '2';
The reason is that the query planner decides to ignore the inde