dbTalk Databases Forums  

[BUGS] Indexes not used for "min()"

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] Indexes not used for "min()" in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Valsecchi, Patrick
 
Posts: n/a

Default [BUGS] Indexes not used for "min()" - 08-01-2003 , 11:01 AM






Your name : Patrick=20
Your email address : Valsecchi


System Configuration
---------------------
Architecture (example: Intel Pentium) : Intel Pentium

Operating System (example: Linux 2.0.26 ELF) : Linux 2.4.20

PostgreSQL version (example: PostgreSQL-7.3.3): PostgreSQL-7.3.3

Compiler used (example: gcc 2.95.2) : gcc 3.2


Please enter a FULL description of your problem:
------------------------------------------------

When doing the following query, it's obvious that postgres should use
the index:

stats=3D# explain select min(time) from call;
QUERY PLAN
------------------------------------------------------------------------
Aggregate (cost=3D49779.82..49779.82 rows=3D1 width=3D8)
-> Seq Scan on stb_call (cost=3D0.00..44622.06 rows=3D2063106 width=3D=
8)
(2 rows)

stats=3D# \d call
Table "public.call"
Column | Type | Modifiers
---------+--------------------------+-----------
a | integer | not null
b | integer | not null
time | timestamp with time zone | not null
d | character varying(4) |
e | character varying(4) |
f | character varying(4) |
g | character varying(15) | not null
h | character varying(7) |
i | smallint | not null
Indexes: call_time btree ("time")

stats=3D# select count(*) from call;
count
---------
2063106
(1 row)

If you have any question or comment, please contact me directly, I'm not
suscribed to the list.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.