Re: Very slow 101-feeling design/query..

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

 





On Dec 10, 2021, at 5:53 PM, Wells Oliver <wells.oliver@xxxxxxxxx> wrote:

SELECT DISTINCT game_id FROM vw_joints

Seeing distinct makes me cringe; most uses of it foreshadow either a poor design or a bad query; not always but more often than not.

If you’re really trying to do a distinct you can select from the game table and do an exists against plays and joints tables thus removing the distinct clause; but I digress as the given query is most likely an over simplified query just as example.

Partitioning does nothing here as the query doesn’t filter on the partitioned field thus no partition elimination.



[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux