Re: Question about indexing!

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jeong Jaeick, 정재익 <advance(at)advance(dot)sarang(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Question about indexing!
Date: 2001-10-02 16:32:33
Message-ID: Pine.BSF.4.21.0110020927590.46517-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Tue, 2 Oct 2001, [euc-kr] Jeong Jaeick, wrote:

> select * from pgsql_bbs where topic = 'qna' and deleted < 2
> order by gid desc, pos asc limit 20, 0;
>
> But this query is not using index!
>
> The next is result of explain of this query:
>
> dsn=# explain select * from pgsql_bbs where topic = 'qna' and deleted < 2
> dsn-# order by gid desc, pos asc limit 20, 0;
> NOTICE: QUERY PLAN:
>
> Limit (cost=15.71..15.71 rows=11 width=245)
> -> Sort (cost=15.71..15.71 rows=11 width=245)
> -> Index Scan using pgsql_topic_deleted on pgsql_bbs (cost=0.00..15.51 rows=11 width=245)

It appears to be using the topic_deleted index according to this
explain output.
How many rows actually have topic='qna' and deleted<2?

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-10-02 16:47:00 Re: aggregate functions, COUNT
Previous Message Kevin Way 2001-10-02 16:11:21 aggregate functions, COUNT