Re: Query on postgresql 7.4.2 not using index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: arnaulist(at)andromeiberica(dot)com
Cc: chris smith <dmagick(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Query on postgresql 7.4.2 not using index
Date: 2006-04-25 15:22:59
Message-ID: 19483.1145978579@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Arnau <arnaulist(at)andromeiberica(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Arnau 2006-04-25 15:47:46 Re: Query on postgresql 7.4.2 not using index
Previous Message Scott Marlowe 2006-04-25 15:05:02 Re: Query on postgresql 7.4.2 not using index