pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: MichaelDBA@sqlexec.com <michaeldba@sqlexec.com>
To: Michael Lewis <mlewis@entrata.com>
Cc: Guillaume Cottenceau <gc@mnc.ch>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: much slower query in production
Date: Wed, 26 Feb 2020 14:18:31 -0500
Message-ID: <69844C34-DF13-46E6-BE7C-C9DABE19D391@sqlexec.com> (raw)
In-Reply-To: <CAHOFxGp9K3LHR8ejzDvMyNNv9WmpyyA6CvctZGTeh3iJ38kcwg@mail.gmail.com>
References: <CAHOFxGp9K3LHR8ejzDvMyNNv9WmpyyA6CvctZGTeh3iJ38kcwg@mail.gmail.com>

Vacuum everything that you restored

Sent from my iPhone

> On Feb 26, 2020, at 1:19 PM, Michael Lewis <mlewis@entrata.com> wrote:
> 
> 
>> 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.

view thread (11+ messages)  latest in thread

Message-ID: <69844C34-DF13-46E6-BE7C-C9DABE19D391@sqlexec.com>
Permalink:  ../69844C34-DF13-46E6-BE7C-C9DABE19D391@sqlexec.com/
Also on:    postgresql.org/message-id/69844C34-DF13-46E6-BE7C-C9DABE19D391@sqlexec.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: michaeldba@sqlexec.com, mlewis@entrata.com, gc@mnc.ch
  Subject: Re: much slower query in production
  In-Reply-To: <69844C34-DF13-46E6-BE7C-C9DABE19D391@sqlexec.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox