int8 primary keys still not using index without manual JDBC driver patch (7.4RC1)

From: "Craig O'Shannessy" <craig(at)ucw(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: int8 primary keys still not using index without manual JDBC driver patch (7.4RC1)
Date: 2003-11-06 23:43:05
Message-ID: Pine.LNX.4.44.0311071028150.14188-100000@mail.ucw.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

Just thought I'd mention that I really think this problem needs to be
fixed. I

I'm patching the 7.4RC1 JDBC drivers as we speak due to this optimiser
bug, and it's the third time I've had to do this. I would think this bug
causes quite a lot of people to evaluate postgres and decide it has awful
primary key performance! I love postgres, and hate to think that this
could be happening.

template1=# explain select * from lineitem where lineitemid=26845437;
QUERY PLAN
--------------------------------------------------------------
Seq Scan on lineitem (cost=0.00..82685.91 rows=1 width=103)
Filter: (lineitemid = 26845437)
(2 rows)

template1=# explain select * from lineitem where lineitemid=26845437::int8;
QUERY PLAN
--------------------------------------------------------------------------------
Index Scan using lineitem_pkey on lineitem (cost=0.00..3.53 rows=1 width=103)
Index Cond: (lineitemid = 26845437::bigint)
(2 rows)

I've noticed this is in the TODO :
Allow SELECT * FROM tab WHERE int2col = 4 to use int2col index, int8,
float4, numeric/decimal too [optimizer])

Too hard to fix before 7.4 final?

Regards,

Craig

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2003-11-07 00:45:01 Re: int8 primary keys still not using index without manual JDBC driver patch (7.4RC1)
Previous Message Gaetano Mendola 2003-11-06 23:28:21 Re: pg_stat