Port Bug Report: SELECT with like on indexed column say it uses Index scan but didn't do it

From: Unprivileged user <nobody>
To: pgsql-ports(at)postgresql(dot)org
Subject: Port Bug Report: SELECT with like on indexed column say it uses Index scan but didn't do it
Date: 1999-06-09 18:43:27
Message-ID: 199906091843.OAA40355@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports


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

Your name : Alexander N Shulyak
Your email address : alec(at)nikts(dot)nk(dot)ukrtel(dot)net

Category :
Severity :

Summary: SELECT with like on indexed column say it uses Index scan but didn't do it

System Configuration
--------------------
Operating System : FreeBSD-3.1 Linux redhat-6.0

PostgreSQL version : 6.5-Beta3

Compiler used : egcs-1.1.2 release

Hardware:
---------
P II Celeron,64M RAM,HDD 4.3M
6X86, 32M RAM, HDD 2.1M

Versions of other tools:
------------------------
flex-2.5.4

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

Problem Description:
--------------------
When I do query select * from spr where phone like '3554__';
time of execution is jast like the dolumn is not indexed.
\d spr returns:
Table = spr
+----------------------------------+----------------------------------+-------+
| Field | Type | Length|
+----------------------------------+----------------------------------+-------+
| name | varchar() | 0 |
| strhousnum | int4 | 4 |
| housind | char() | 1 |
| korpus | varchar() | 0 |
| flat | varchar() | 0 |
| phone | varchar() | 0 |
| id | int4 | 4 |
| flag | varchar() | 0 |
| subname | varchar() | 0 |
| sstrhousnum | int4 | 4 |
| shousind | char() | 1 |
| skorpus | varchar() | 0 |
| sflat | varchar() | 0 |
| subnote | varchar() | 0 |
| mod | int2 | 2 |
+----------------------------------+----------------------------------+-------+
Index: spr_phone

Query explain select * from spr where phone like '3554__';
returns:
NOTICE: QUERY PLAN:

Index Scan using spr_phone on spr (cost=3785.45 rows=1 width=146)

EXPLAIN
s

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

Test Case:
----------
Quest SELECT with LIKE on big enoughe table and wait for result

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

Solution:
---------

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

Browse pgsql-ports by date

  From Date Subject
Next Message Henry B. Hotz 1999-06-09 23:16:16 Re: Further questions about PostgreSQL
Previous Message Hub.Org News Admin 1999-06-09 16:52:22