Re: much slower query in production

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Guillaume Cottenceau <gc(at)mnc(dot)ch>
Cc: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: much slower query in production
Date: 2020-02-26 18:18:53
Message-ID: CAHOFxGp9K3LHR8ejzDvMyNNv9WmpyyA6CvctZGTeh3iJ38kcwg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>
> UPDATE multicards
> SET defacements = COALESCE( count, 0 )
> FROM ( SELECT multicard_uid, COUNT(*) AS count FROM tickets GROUP BY
> multicard_uid ) AS sub
> WHERE uid = multicard_uid OR multicard_uid is null;
>

I expect this should work. Not sure of performance of course.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message MichaelDBA@sqlexec.com 2020-02-26 19:18:31 Re: much slower query in production
Previous Message Guillaume Cottenceau 2020-02-26 18:04:02 Re: much slower query in production