Re: SQl help to build a result with custom aliased bool column

From: Arup Rakshit <ar(at)zeit(dot)io>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: SQl help to build a result with custom aliased bool column
Date: 2019-04-08 13:51:37
Message-ID: 3B9E3645-57A1-417E-83C0-6660033ABDE0@zeit.io
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Thanks for showing different ways to achieve the goal. So what should be the optimal way to solve this. I have an composite index using company_id and feature_id columns for project_features table.

I do ruby on rails development, where table names are plural always by convention. The tables I created above in different schema to ask question with sample data and test the query output. So they are little inconsistent, yes you are right.

Thanks,

Arup Rakshit
ar(at)zeit(dot)io

> On 08-Apr-2019, at 4:36 PM, mariusz <marius(at)mtvk(dot)pl> wrote:
>
> bear in mind that with a large number of companies and proper index on
> company_features the optimizer could limit company_features as
> necessary, while your examples read everything anyway and mangle output
> to get proper result (with dups and bugs, but also not optimal)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raghavendra Rao J S V 2019-04-08 14:19:01 Re: Getting error while running the pg_basebackup through PGBOUNCER
Previous Message Scot Kreienkamp 2019-04-08 13:46:13 RE: Getting error while running the pg_basebackup through PGBOUNCER