Re: designing time dimension for star schema - Mailing list pgsql-general

From Tom Lane
Subject Re: designing time dimension for star schema
Date
Msg-id 3579.1392084076@sss.pgh.pa.us
Whole thread Raw
In response to Re: designing time dimension for star schema  (Mark Wong <markwkm@gmail.com>)
List pgsql-general
Mark Wong <markwkm@gmail.com> writes:
> On Mon, Feb 10, 2014 at 9:20 AM, CS DBA <cs_dba@consistentstate.com> wrote:
>> In the case of this being a timestamp I suspect the performance would
>> take a hit, depending on the size of your fact table and the
>> scope/volume of your DSS queries this could easily be a show stopper
>> based on the assumption that the database can do a numeric binary search
>> much faster than a timestamp search

> I guess I was hoping the extra 4 bytes from a timestamp, compared to a
> bigint, wouldn't be too significant yet I didn't consider postgres
> might do a binary search faster on an integer type than a timestamp.

Actually, Postgres timestamps *are* bigints under the hood, and
comparisons will be about the same speed as for bigints.  Now, I/O is a
lot more expensive for timestamps ... but not index searches.

            regards, tom lane


pgsql-general by date:

Previous
From: Mark Wong
Date:
Subject: Re: designing time dimension for star schema
Next
From: Merlin Moncure
Date:
Subject: Re: designing time dimension for star schema