Re: Suggestion to improve query performance of data validation in proc.

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: postgann2020 s <postgann2020(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Subject: Re: Suggestion to improve query performance of data validation in proc.
Date: 2020-05-22 14:26:05
Message-ID: CAHOFxGpchYLK0H0kNFQT1pfqk3oyMhEWNCaPsne5nzXLi4QJCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-performance

On Fri, May 22, 2020 at 2:09 AM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Friday, May 22, 2020, postgann2020 s <postgann2020(at)gmail(dot)com> wrote:
>
>
>>
>> We are looking for a better query than "*SELECT 1 FROM
>> schema.table_name WHERE column1=structure_id1*" this query for data
>> validation.
>>
>
If many rows match potentially, then wrapping the query with select
exists(old_query) would allow the execution to bail asap.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Keith 2020-05-22 14:29:48 Re: Lag clarification with Sync Replication
Previous Message Michael Lewis 2020-05-22 14:14:29 Re: Request to help on GIS Query improvement suggestion.

Browse pgsql-general by date

  From Date Subject
Next Message Michael Lewis 2020-05-22 14:30:16 Re: Inaccurate (sometimes wildly so) row estimates for simple join
Previous Message Tom Lane 2020-05-22 14:22:58 Re: Query returns no rows in pg_basebackup cluster

Browse pgsql-performance by date

  From Date Subject
Next Message Rory Campbell-Lange 2020-05-22 14:48:20 Strategy for materialisation and centralisation of data
Previous Message Michael Lewis 2020-05-22 14:14:29 Re: Request to help on GIS Query improvement suggestion.