From: Mindaugas Riauba <mind@bi.lt>
To: pgsql-performance@postgresql.org
Subject: Re: What is the fastest null WHERE
Date: Wed, 1 Oct 2003 16:05:41 +0300
Message-ID: <085401c3881c$bacfaca0$f20214ac@bite.lt> (raw)
References: <07c001c38815$29277b90$f20214ac@bite.lt>
<200310011339.01707.dev@archonet.com>
> > 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.
Thanks. I'll use "WHERE true" for now. And of course it is
not necessary it just simplifies code a bit.
> Most languages will have a join() operator that lets you do something
like:
>
> $where_cond = join(' AND ', @list_of_tests)
That's not the case. Test may or may not be performed based on
web form values.
Mindaugas
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: mind@bi.lt
Subject: Re: What is the fastest null WHERE
In-Reply-To: <085401c3881c$bacfaca0$f20214ac@bite.lt>
References: <07c001c38815$29277b90$f20214ac@bite.lt> <200310011339.01707.dev@archonet.com> <085401c3881c$bacfaca0$f20214ac@bite.lt>
* 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