Re: What is the fastest null WHERE

From: Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: Mindaugas Riauba <mind(at)bi(dot)lt>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: What is the fastest null WHERE
Date: 2003-10-01 12:32:14
Message-ID: 3F7AC94E.1000407@persistent.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Mindaugas Riauba wrote:

> Hello,
>
> While writing web application I found that it would
> be very nice for me to have "null" WHERE clause. Like
> WHERE 1=1. Then it is easy to concat additional
> conditions just using $query . " AND col=false" syntax.
>
> But which of the possible "null" clauses is the fastest
> one?

Rather than this approach, keep a flag which tells you whether or not it is
first where condition. If it is not first where condition, add a 'and'. That
would be simple, isn't it?

Shridhar

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Richard Huxton 2003-10-01 12:39:01 Re: What is the fastest null WHERE
Previous Message Jeff 2003-10-01 12:23:10 Re: Tuning/performance issue...