Re: Optimizing IN queries - Mailing list pgsql-general

From Andrus
Subject Re: Optimizing IN queries
Date
Msg-id 0F95FE61C6C244418A3FEF881B7B0287@andrusnotebook
Whole thread Raw
In response to Re: Optimizing IN queries  ("Isak Hansen" <isak.hansen@gmail.com>)
List pgsql-general
Isak,

> Looks to me like most of the time is spent doing "not in (select a ton
> of rows from bilkaib)".
>
> Try something like "not exists (select null from bilkaib b where
> b.dokumnr = dok.dokumnr and alusdok = 'LY')".

Thank you very much.
Query seems to return now immediately.

dok.dokumnr is not null
bilkaib.dokumnr can be null

I hope that modified query produces same results as original.

Andrus.

pgsql-general by date:

Previous
From: "Isak Hansen"
Date:
Subject: Re: Optimizing IN queries
Next
From: Devrim GÜNDÜZ
Date:
Subject: Multiple postmaster installation with RPMs