Re: What is the fastest null WHERE

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Mindaugas Riauba" <mind(at)bi(dot)lt>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: What is the fastest null WHERE
Date: 2003-10-01 12:39:01
Message-ID: 200310011339.01707.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wednesday 01 October 2003 13:11, 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?

I suspect WHERE true, but is it really necessary.

Most languages will have a join() operator that lets you do something like:

$where_cond = join(' AND ', @list_of_tests)

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Rod Taylor 2003-10-01 12:51:46 Re: What is the fastest null WHERE
Previous Message Shridhar Daithankar 2003-10-01 12:32:14 Re: What is the fastest null WHERE