Re: How to optimize SELECT query with multiple CASE statements?

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to optimize SELECT query with multiple CASE statements?
Date: 2016-10-31 16:50:10
Message-ID: CAEzk6fdkjKATL14KPx3E3q6wYoTvUz-Lew0T0atTjvDqnaqbXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 31 October 2016 at 15:46, Alexander Farber
<alexander(dot)farber(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kiran 2016-10-31 17:02:15 Re: Rows are repeating by the trigger function
Previous Message David G. Johnston 2016-10-31 16:17:00 Re: How to optimize SELECT query with multiple CASE statements?