From: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
To: Mindaugas Riauba <mind@bi.lt>
Cc: pgsql-performance@postgresql.org
Subject: Re: What is the fastest null WHERE
Date: Wed, 01 Oct 2003 18:02:14 +0530
Message-ID: <3F7AC94E.1000407@persistent.co.in> (raw)
In-Reply-To: <07c001c38815$29277b90$f20214ac@bite.lt>
References: <07c001c38815$29277b90$f20214ac@bite.lt>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: shridhar_daithankar@persistent.co.in, mind@bi.lt
Subject: Re: What is the fastest null WHERE
In-Reply-To: <3F7AC94E.1000407@persistent.co.in>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox