Re: Performance question

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: Anil Menon <gakmenon(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Performance question
Date: 2014-11-19 18:21:00
Message-ID: CA+bJJbwzmxM4o6NN9i7TiY1P+c4Gz3KaE9iHLvMLs5TL1pRFGQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Anil:

On Wed, Nov 19, 2014 at 5:26 PM, Anil Menon <gakmenon(at)gmail(dot)com> wrote:

> Cons : It seems doing a count(*) is not the best option for PG
>

For this and some of the following options, if you are going to just test
for existence, I would consider adding a limit 1 somewehere on the query,
to let the optimizer know you only need one and it will abort the scan on
first hit. Probabley not needed if you are going to give a query which uses
an unique index, but it shouldn't hurt.

Francisco Olarte.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-11-19 19:46:58 Re: Performance question
Previous Message Jeff Janes 2014-11-19 17:31:50 Re: [general] Error while decrypting using pgp