Re: How to optimize SELECT query with multiple CASE statements? - Mailing list pgsql-general

From Geoff Winkless
Subject Re: How to optimize SELECT query with multiple CASE statements?
Date
Msg-id CAEzk6fdkjKATL14KPx3E3q6wYoTvUz-Lew0T0atTjvDqnaqbXg@mail.gmail.com
Whole thread Raw
In response to Re: How to optimize SELECT query with multiple CASE statements?  (Alexander Farber <alexander.farber@gmail.com>)
Responses Re: How to optimize SELECT query with multiple CASE statements?
List pgsql-general
On 31 October 2016 at 15:46, Alexander Farber
<alexander.farber@gmail.com> wrote:
> do you mean, instead of having player1, player2 columns in the words_games
> table (as in my current schema
> https://gist.github.com/afarber/c40b9fc5447335db7d24 ) - I should move the
> player stuff (uid, hand, score) to a separate table and then JOIN them?

I do - it's something that my databases lecturer would almost
certainly have insisted upon, although I'm not sure it's worth it,
especially since (as I said in the last paragraph of my email), you
can remove all of the CASEs except the hand/score ones by just JOINing
the other tables via a CASE anyway.

Geoff


pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: How to optimize SELECT query with multiple CASE statements?
Next
From: Kiran
Date:
Subject: Re: Rows are repeating by the trigger function