Re: Querying with arrays - Mailing list pgsql-sql

From Gerardo Herzig
Subject Re: Querying with arrays
Date
Msg-id 1462618385.1624233.1417722978423.JavaMail.root@fmed.uba.ar
Whole thread Raw
In response to Re: Querying with arrays  (Tim Dudgeon <tdudgeon.ml@gmail.com>)
List 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
readthe data).
 
Thats why it is using a seq scan.

Gerardo



pgsql-sql by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: Querying with arrays
Next
From: "Huang, Suya"
Date:
Subject: rolling window without aggregation