Re: Performance question - Mailing list pgsql-general

From Francisco Olarte
Subject Re: Performance question
Date
Msg-id CA+bJJbwzmxM4o6NN9i7TiY1P+c4Gz3KaE9iHLvMLs5TL1pRFGQ@mail.gmail.com
Whole thread Raw
In response to Performance question  (Anil Menon <gakmenon@gmail.com>)
List pgsql-general
Hi Anil:

On Wed, Nov 19, 2014 at 5:26 PM, Anil Menon <gakmenon@gmail.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.

pgsql-general by date:

Previous
From: Anil Menon
Date:
Subject: Performance question
Next
From: Adrian Klaver
Date:
Subject: Re: Performance question