Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group