agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Gerardo Herzig <gherzig@fmed.uba.ar>
To: Tim Dudgeon <tdudgeon.ml@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Querying with arrays
Date: Thu, 4 Dec 2014 16:56:18 -0300 (ART)
Message-ID: <1462618385.1624233.1417722978423.JavaMail.root@fmed.uba.ar> (raw)
In-Reply-To: <548064AE.4020407@gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (6+ messages)

Message-ID: <1462618385.1624233.1417722978423.JavaMail.root@fmed.uba.ar>
Permalink:  ../1462618385.1624233.1417722978423.JavaMail.root@fmed.uba.ar/
Also on:    postgresql.org/message-id/1462618385.1624233.1417722978423.JavaMail.root@fmed.uba.ar

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gherzig@fmed.uba.ar, tdudgeon.ml@gmail.com
  Subject: Re: Querying with arrays
  In-Reply-To: <1462618385.1624233.1417722978423.JavaMail.root@fmed.uba.ar>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox