Re: JBoss w/int8 primary keys in postgres ...

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: James Robinson <jlrobins(at)socialserve(dot)com>, "pgsql-jdbc (at) postgresql (dot) org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JBoss w/int8 primary keys in postgres ...
Date: 2003-09-11 13:25:58
Message-ID: 20030911142558.A6914@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 11/09/2003 04:42 Tom Lane wrote:
> Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk> writes:
> > I think the first big hurdle is going to be making them realize that
> with
> > CMP there _is no_ SQL source to modify in the first place. Yes, I think
>
> > you need to petition hackers and maybe x-post to advocacy too - there
> are
> > also people there who need to be made aware that PostgreSQL has a
> serious
> > Achilles heel as an enterprise database!
>
> <rolls eyes> Do you think we have not heard about the datatype-mismatch
> issue ten thousand times before? Don't waste our time with "petitions".
> Give us a practical way to fix it (ie, one that doesn't create more
> problems than it solves). See for example
> http://archives.postgresql.org/pgsql-hackers/2002-11/msg00468.php
> as a recent discussion of the pitfalls involved.

Without meaningful knowledge of the back-end internals its difficult for
me to see where that discussion fits in...

>
> It occurred to me this afternoon that we might be able to improve
> matters for int8 without necessarily fixing the general problem.
> The problems cited in the above message mostly stem from trying to
> type small constants as int2 so that "int2col = 42" is indexable.
> Once upon a time it seemed that was where the hot buttons were, but
> if your hot button is mostly int8, maybe we could fix that by removing
> the int8-vs-int4 cross-type operators, and not touch the initial typing
> of integer literals just yet. Does someone want to explore the
> consequences of trying that?

Maybe the answer lies in finding out why I can define define an index on a
double precision column 'quantity' and the the planner will use the index
:-

test_db=#\d type_test

Table "public.type_test"
Column | Type | Modifiers
----------+------------------+-----------
id | integer | age | smallint | quantity |
double precision | Indexes: type_test_age btree (age),
type_test_qty btree (quantity)

test_db=# explain select * from type_test where quantity = 0;

QUERY
PLAN
--------------------------------------------------------------------------------
Index Scan using type_test_qty on type_test (cost=0.00..3.35 rows=1
width=14)
Index Cond: (quantity = 0::double precision)
(2 rows)

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message James Robinson 2003-09-11 13:28:50 Re: JBoss w/int8 primary keys in postgres ...
Previous Message Muehlencord, Joern 2003-09-11 08:13:32 German Umlauts and JDBC