Re: Type Categories for User-Defined Types

From: "Ryan Bradetich" <rbradetich(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Type Categories for User-Defined Types
Date: 2008-07-30 15:11:37
Message-ID: e739902b0807300811v5c6e7942tf3d0767bc6905f9f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Tom,

On Wed, Jul 30, 2008 at 7:50 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Dunno, I forget what the conclusion was about implicit casting for the
> unsigned types in your proposal. Have you experimented with seeing
> whether, eg, UNION'ing an unsigned with some signed-integer value
> behaves sensibly?

That was not one of my tests, but I will add it :)

Here are the performance tests I am planning / working on:

1. Loading of both integer and unsigned integers into a table. This test is
mainly a sanity check to ensure the unsigned integers do not add
significant time during inserts. In a perfect world, I believe they should
take the same time when the unsigned integers and integers have equal
widths. Experimentation is showing the unsigned integer to take slightly
longer. I suspect this is due to the additional integer->unsigned
integer cast? I am still digging into this for my personal curiosity.

2. Testing the < operator. The unsigned integer type provides a native cast
for the < operator.

3. Testing the & operator. The unsigned integer type does not provide a
native cast for the & operator, so they are cast up to the next larger size.

I am testing this for both signed and unsigned integers with data sets of the
following sizes: 100, 1000, 10000, 100000, 500000, 1M, 5M, and 10M rows.
I am planning to test on both 32-bit and 64-bit x86 platforms. If there is
interest, I can also run these tests on 32-bit and 64-bit PowerPC platforms.

I will add the union test to my test plan. Anything else I should add or any
holes I am missing with this test plan?

> The thread I mention above was a year or so back and was originated by
> someone who wanted to duplicate mysql's behavior. Your proposal is
> a lot more limited and might not really need to try to put the unsigned
> types into the numeric category.

Ah, ok. I will not worry about it for now.

Thanks!

- Ryan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2008-07-30 15:17:59 Re: TABLE-function patch vs plpgsql
Previous Message Tom Lane 2008-07-30 14:56:36 Re: printing raw parse tree