Re: Querying with arrays

From: Gerardo Herzig <gherzig(at)fmed(dot)uba(dot)ar>
To: Tim Dudgeon <tdudgeon(dot)ml(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Querying with arrays
Date: 2014-12-04 19:56:18
Message-ID: 1462618385.1624233.1417722978423.JavaMail.root@fmed.uba.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
> The plan for the query is this:
>
> "Seq Scan on lists (cost=0.00..16.88 rows=3 width=86) (actual
> time=0.006..0.008 rows=1 loops=1)"
> " Filter: (hits @> '{7}'::integer[])"
> "Planning time: 0.058 ms"
> "Execution time: 0.025 ms"
>
> What am I doing wrong?
>
> Tim
>

With so few rows to read, it is actually slower to do a index scan followed by the table scan (in order to actually read the data).
Thats why it is using a seq scan.

Gerardo

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Huang, Suya 2014-12-05 07:25:17 rolling window without aggregation
Previous Message Achilleas Mantzios 2014-12-04 13:54:49 Re: Querying with arrays