Re: much slower query in production

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

 



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





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

  Powered by Linux