Re: 335 times faster (!) [Viruschecked] [Viruschecked]

From: "Patric Bechtel" <bechtel(at)ipcon(dot)de>
To: "Mikael Carneholm" <carniz(at)spray(dot)se>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: 335 times faster (!) [Viruschecked] [Viruschecked]
Date: 2003-02-03 21:55:17
Message-ID: 20030203215554.833A54758F1@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 03 Feb 2003 22:47:22 +0100, Patric Bechtel wrote:

Hello Mikael,

sorry for bothering, but I oversaw that you wrote on the
GENERAL list... my patch is only for the JDBC drive. It
probably isn't the "right" way to fix it, but digging into
that backend issue is clearly beyond my skills... :-)

Patric

>On Mon, 03 Feb 2003 20:23:28 +0100, Mikael Carneholm wrote:

>Hallo Mikael,

>it's been around for about a month or so:
>I've submitted a patch on the patches list, which fixes
>this (kind of, at least for Castor/OJB/Hibernate) when
>the URL-parameter useExplicitTyping=true is set.
>Just try it, there are several other very nice
>features; but nobody seems to had an eye on it till now... :-(

>If there's interest, I've improved the patch even
>further, and keep it in sync with the current CVS;
>since there's no interest so far, I'm not submitting
>them; except someone tries and applies them.

>tia
>Patric

>>> ------- Ursprungligt meddelande -------
>>>
>>> Från: Mario Weilguni <mweilguni(at)sime(dot)com>
>>> Datum: Mon, 3 Feb 2003 20:05:48 +0100
>>>
>>>try:
>>>explain select * from enheter where enhetsid = '200178146';
>>>or
>>>explain select * from enheter where enhetsid = 200178146::bigint
>>>

>>explain select * from enheter where enhetsid = '200178146';
>> QUERY PLAN
>---------------------------------------------------------------------------
>>Index Scan using pk_enheter on enheter (cost=0.00..4.05 rows=1 width=91)
>>Index Cond: (enhetsid = 200178146::bigint)
>>(2 rows)

>>Strange...using:
>>200178146::bigint
>>or
>>'200178146'
>>..the query is lightning fast. Since the PK column is of integer type, I don't think it's logical to pass a string-type argument...or am I different than most
>people on this point? :)

>>What about third party frameworks (such as Hibernate, eg) - I'm sure they will look at the column datatype and think: 'Oh, it's an integer...I'll pass an
>integer argument then', which will result in unnecessary poor performance.

>>What's the cause of this behaviour? Why isn't psql (or the backend) converting integer type arguments into char/string types, if there's this much to gain?

>>(Sorry for being quite a Pg newbie..have never used Pg for such "heavy" load before)

>>- Mikael

>>_____________________________________________________________
>>Här börjar internet!
>>Skaffa gratis e-mail och gratis internet på http://www.spray.se

>>Träffa folk från hela Sverige på ett och samma ställe - http://chat.spray.se/

>>---------------------------(end of broadcast)---------------------------
>>TIP 6: Have you searched our list archives?

>>http://archives.postgresql.org

>PGP Public Key Fingerprint: 2636 F26E F523 7D62 4377 D206 7C68 06BB

>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>message can get through to the mailing list cleanly

>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>message can get through to the mailing list cleanly

PGP Public Key Fingerprint: 2636 F26E F523 7D62 4377 D206 7C68 06BB

-----BEGIN PGP SIGNATURE-----
Version: PGPsdk version 1.7.1 (C) 1997-1999 Network Associates, Inc. and its affiliated companies.

iQA/AwUBPj7XNnxoBrvMu8qQEQLphgCdFp4zC7Rgn44jqOGJGttnmf0vBuIAn2P9
8YhRpfuzfvaU/ErQ1VOH0NL1
=wwrt
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2003-02-03 22:00:08 Re: 335 times faster (!)
Previous Message Mikael Carneholm 2003-02-03 21:53:58 Re: What is the benefit of schemas?