Re: Query on postgresql 7.4.2 not using index - Mailing list pgsql-performance

From Tom Lane
Subject Re: Query on postgresql 7.4.2 not using index
Date
Msg-id 19483.1145978579@sss.pgh.pa.us
Whole thread Raw
In response to Re: Query on postgresql 7.4.2 not using index  (Arnau <arnaulist@andromeiberica.com>)
Responses Re: Query on postgresql 7.4.2 not using index
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Query on postgresql 7.4.2 not using index
Next
From: Arnau
Date:
Subject: Re: Query on postgresql 7.4.2 not using index