pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas <maps.on@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Better way to check more than 1 value NOT IN (...)
Date: Sat, 24 Sep 2011 11:38:48 +0200
Message-ID: <4E7DA528.9010902@gmx.net> (raw)

Hi,
I've got to check if 2 values are not in a set that is dynamically 
calculated by a function.

The query looks like

select  some_id, ....
from .....
where   10  is not in ( select x from my_function (some_id))
and   20  is not in ( select x from my_function (some_id))

Is there a efficiency issue with calculating the set twice ?
Can I somehow check both (or more) values at once?



view thread (2+ messages)  latest in thread

Message-ID: <4E7DA528.9010902@gmx.net>
Permalink:  ../4E7DA528.9010902@gmx.net/
Also on:    postgresql.org/message-id/4E7DA528.9010902@gmx.net

 · 

reply

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-sql@postgresql.org
  Cc: maps.on@gmx.net
  Subject: Re: Better way to check more than 1 value NOT IN (...)
  In-Reply-To: <4E7DA528.9010902@gmx.net>

* 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