Skip site navigation (1) Skip section navigation (2)

General Bug Report: Bug in optimizer

From: Unprivileged user <nobody>
To: pgsql-bugs(at)postgresql(dot)org
Subject: General Bug Report: Bug in optimizer
Date: 1999-03-18 13:34:57
Message-ID: 199903181334.IAA17885@hub.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name		: Andriy I Pilipenko
Your email address	: bamby(at)marka(dot)net(dot)ua

Category		: runtime: back-end: SQL
Severity		: serious

Summary: Bug in optimizer

System Configuration
--------------------
  Operating System   : FreeBSD 2.2.6, FreeBSD 3.1, Linux 2.0.36

  PostgreSQL version : 6.4.2

  Compiler used      : gcc 2.7.2.1

Hardware:
---------
Pentium, AMD K6, 256M RAM, 64M RAM

Versions of other tools:
------------------------
gmake 3.76.1, flex 2.5.4

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

Problem Description:
--------------------
Backend forgets about indexes if WHERE clause includes 
negative number. This causes great slowdown in queries
on large tables.

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

Test Case:
----------
Here is an example session. Note that in first SELECT
backend uses index scan, and in second one it uses 
sequental scan.

== cut ==
bamby=> create table table1 (field1 int);
CREATE
bamby=> create index i_table1__field1 on table1 (field1);
CREATE
bamby=> explain select * from table1 where field1 = 1;
NOTICE:  QUERY PLAN:

Index Scan using i_table1__field1 on table1  (cost=0.00 size=0 width=4)

EXPLAIN
bamby=> explain select * from table1 where field1 = -1;
NOTICE:  QUERY PLAN:

Seq Scan on table1  (cost=0.00 size=0 width=4)

EXPLAIN
== cut ==

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

Solution:
---------


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


Responses

pgsql-hackers by date

Next:From: Vadim MikheevDate: 1999-03-18 13:55:22
Subject: Re: [BUGS] General Bug Report: Bug in optimizer
Previous:From: Jan WieckDate: 1999-03-18 12:07:14
Subject: Re: [HACKERS] One more globe

pgsql-bugs by date

Next:From: Vadim MikheevDate: 1999-03-18 13:55:22
Subject: Re: [BUGS] General Bug Report: Bug in optimizer
Previous:From: Bruce MomjianDate: 1999-03-17 16:15:30
Subject: Re: [BUGS] General Bug Report: backend closes with aggregate functions on views

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group