pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: arnaulist@andromeiberica.com
Cc: chris smith <dmagick@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query on postgresql 7.4.2 not using index
Date: Tue, 25 Apr 2006 11:22:59 -0400
Message-ID: <19483.1145978579@sss.pgh.pa.us> (raw)
In-Reply-To: <444E28ED.3090900@andromeiberica.com>
References: <444E240D.3050000@andromeiberica.com>
	<3c1395330604250634r6f215ceame157f3dd5f5f4fa3@mail.gmail.com>
	<444E28ED.3090900@andromeiberica.com>

Arnau <arnaulist@andromeiberica.com> writes:

>   Seq Scan on agenda_users_groups  (cost=0.00..53108.45 rows=339675 
> width=8) (actual time=916.903..5763.830 rows=367026 loops=1)
>     Filter: (group_id = 9::numeric)
>   Total runtime: 7259.861 ms
> (3 filas)

> espsm_moviltelevision=# select count(*) from agenda_users_groups ;
>    count
> ---------
>   2547556

So the SELECT is fetching nearly 15% of the rows in the table.  The
planner is doing *the right thing* to use a seqscan, at least for
this particular group_id value.

			regards, tom lane



view thread (11+ messages)  latest in thread

Message-ID: <19483.1145978579@sss.pgh.pa.us>
Permalink:  ../19483.1145978579@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19483.1145978579@sss.pgh.pa.us

 · 

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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, arnaulist@andromeiberica.com, dmagick@gmail.com
  Subject: Re: Query on postgresql 7.4.2 not using index
  In-Reply-To: <19483.1145978579@sss.pgh.pa.us>

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

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