Re: much slower query in production

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

Michael Lewis <mlewis 'at' entrata.com> writes:

> 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.

This looked great but as it seems you suspected, it's very slow :/
I interrupted it after 5 minutes run on my dev computer.

--
Guillaume Cottenceau

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2020-02-26 22:59:56 Re: much slower query in production
Previous Message MichaelDBA@sqlexec.com 2020-02-26 19:18:31 Re: much slower query in production