Re: Querying with arrays

From: Tim Dudgeon <tdudgeon(dot)ml(at)gmail(dot)com>
To:
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Querying with arrays
Date: 2014-11-27 16:55:35
Message-ID: 54775787.4030801@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 27/11/2014 14:54, Tom Lane wrote:
> You could create a GIN index on lists.hits and then do
>
> SELECT t1.*
> FROM some_table t1
> JOIN lists l ON array[t1.id] <@ l.hits
> WHERE l.id = 2;
>
> How efficient that will be remains to be determined though;
> if the l.id condition will eliminate a lot of matches it
> could still be kind of slow.
Afraid that was *much* slower.

Tim

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jason Aleksi 2014-11-30 00:27:30 regr_slope function with auto creation of X column
Previous Message Tom Lane 2014-11-27 14:54:30 Re: Querying with arrays