Re: much slower query in production

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vacuum everything that you restored

Sent from my iPhone

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

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux