Re: SELECT * FROM t where p or q;

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: <frbn(at)efbs-seafrigo(dot)fr>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: SELECT * FROM t where p or q;
Date: 2001-11-20 08:10:16
Message-ID: 20011120000953.M53451-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Fri, 16 Nov 2001 frbn(at)efbs-seafrigo(dot)fr wrote:

> hi,
> on a +10 millions rec table, a simple select:
>
> SELECT * FROM tab where num = x;
>
> time: 5 secondes
>
> SELECT * FROM tab where num = y;
>
> time: 5 secondes
>
>
> SELECT * FROM tab WHERE num = x OR num = y;
>
> time: more than 10 mn !!!
>
> num is an integer.

Have you run vacuum analyze, what does explain show
on the three queries?

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dino Cherian 2001-11-20 10:10:00 When to connect and disconnect Connection
Previous Message Stephan Szabo 2001-11-20 08:09:26 Re: Foreign Key Constraint Deletion Order