The old "not using index" question

From: "Jan-Philipp 'Thefly' Reining" <jpr(at)turtle-entertainment(dot)de>
To: <pgsql-general(at)postgresql(dot)org>
Subject: The old "not using index" question
Date: 2002-11-29 16:37:04
Message-ID: 02cd01c297c5$8cfcbb80$84c206d4@thefly
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there,

---this one is using the index on "ranking"
SELECT *
FROM ttm_slots s
WHERE s.peering = 72
AND s.ranking = 1050

---but this one does not?
SELECT *
FROM ttm_slots s
WHERE s.peering = 72
AND s.ranking < 1050
AND s.ranking > 950

The index ist "btree", so it should be able to use the index with a < >
comparison?

\d ranking_ttm_slots_key
Index "ranking_ttm_slots_key"
Column | Type
---------+---------
ranking | integer
btree

regards,
Jan-Philipp

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2002-11-29 17:14:07 Re: One SQL to access two databases.
Previous Message Alejandro Michelin Salomon ( Adinet ) 2002-11-29 16:31:34 PostgreSql on windows