pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zoolin Lin <zoolin3g@yahoo.com>
To: pgsql-performance@postgresql.org
Subject: Any advantage to integer vs stored date w. timestamp
Date: Tue, 6 Mar 2007 13:49:27 -0800 (PST)
Message-ID: <20070306214927.30058.qmail@web63311.mail.re1.yahoo.com> (raw)

Hi,

I have database with a huge amount of data so i'm trying to make it as fast as possible and minimize space.

One thing i've done is join on a prepopulated date lookup table to prevent a bunch of rows with duplicate date columns. Without this I'd have about 2500 rows per hour with the exact same date w. timestamp in them.

My question is, with postgres do I really gain anything by this, or should I just use the date w. timestamp column on the primary table and ditch the join on the date_id table.

Primary table is all integers like:

date id | num1 | num2 | num3 | num4 | num5 | num6 | num7 | num 8
-------------------------------------------------------------------------------------------------
primary key is on date to num->6 columns

date_id lookup table:

This table is prepopulated with the date values that will be used.

date_id | date w timestamp
----------------------------------------
1         | 2007-2-15 Midnight
2         | 2007-2-15 1 am
3         | 2007-2-15 2 am  etc for 24 hours each day


Each day 60k records are added to a monthly table structured as above, about 2500 per hour.

thank you for your advice

 
---------------------------------
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.

view thread (7+ messages)  latest in thread

Message-ID: <20070306214927.30058.qmail@web63311.mail.re1.yahoo.com>
Permalink:  ../20070306214927.30058.qmail@web63311.mail.re1.yahoo.com/
Also on:    postgresql.org/message-id/20070306214927.30058.qmail@web63311.mail.re1.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: zoolin3g@yahoo.com
  Subject: Re: Any advantage to integer vs stored date w. timestamp
  In-Reply-To: <20070306214927.30058.qmail@web63311.mail.re1.yahoo.com>
  References: <20070306214927.30058.qmail@web63311.mail.re1.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox