Re: Determining which index to create

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Eric Cholet <cholet(at)logilune(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Determining which index to create
Date: 2001-11-21 14:04:58
Message-ID: 20011122010458.B537@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Nov 21, 2001 at 12:53:09PM +0100, Eric Cholet wrote:
> I should have mentionned I tried that, but it isn't being used:
>
> => \d dico_frs_motid_date
> Index "dico_frs_motid_date"
> Attribute | Type
> -----------+--------------------------
> motid | integer
> date | timestamp with time zone
> btree
>
> => explain select * from dico_frs where motid=4742 order by date desc limit
> 10;
> NOTICE: QUERY PLAN:
>
> Limit (cost=0.00..17591.91 rows=10 width=16)
> -> Index Scan Backward using dico_frs_date on dico_frs
> (cost=0.00..20023641.63 rows=11382 width=16)

Well, it is doing the scan backwards, which is good. But it's not using the
index. If you drop dico_frs_date index, does it do it then?

Oh, and what version of postgres was this again?
--
Martijn van Oosterhout <kleptog(at)svana(dot)org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Link 2001-11-21 14:21:27 Re: Performance: Perl-DBI vs. PG Stored Procedures
Previous Message PostgreSQL List User 2001-11-21 12:06:07 ODBC with SSL...