Port Bug Report: Strange choice of index, or no choice of index, for numeric keys

From: Unprivileged user <nobody>
To: pgsql-ports(at)postgresql(dot)org
Subject: Port Bug Report: Strange choice of index, or no choice of index, for numeric keys
Date: 1999-03-31 08:28:40
Message-ID: 199903310828.DAA64740@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports


============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Philip Warner
Your email address : pjw(at)rhyme(dot)com(dot)au

Category : runtime: back-end: SQL
Severity : non-critical

Summary: Strange choice of index, or no choice of index, for numeric keys

System Configuration
--------------------
Operating System : Linux 2.0.35

PostgreSQL version : 6.4

Compiler used : gcc 2.7.2.1

Hardware:
---------
Pentium, 80MB
Linux Acheron 2.0.35 #8 Wed Aug 19 11:54:15 MEST 1998 i586 unknown

Versions of other tools:
------------------------

--------------------------------------------------------------------------

Problem Description:
--------------------
The query optimizer seems to not use indexes for indexes based on float data types, or for range queries based on integers. This seems stramge.

--------------------------------------------------------------------------

Test Case:
----------
Create Table test(f1 float4, f2 int4);
Create Unique Index test_ix1 on test(f1);
Create Unique Index test_ix2 on test(f2);

explain select * from test where f1 = 1.0;
# This does not use an index, this may be OK since it's a float.

explain select * from test where f2 = 1;
#This uses an index, which is good.

explain select * from test where f2 > 1 and f2 < 3;
#This does not use an index, which is strange.

--------------------------------------------------------------------------

Solution:
---------

--------------------------------------------------------------------------

Browse pgsql-ports by date

  From Date Subject
Next Message Gyurcsan Ferenc Tamas 1999-04-09 17:31:31 6.5beta, and problems with pgaccess
Previous Message Billy G. Allie 1999-03-31 08:06:41 Bug Report - Compile errors in vacuum.c and shmem.c