Re: does timestamp precision affect storage size?

From: Vik Fearing <vik(at)2ndquadrant(dot)fr>
To: Jonathan Vanasco <postgres(at)2xlp(dot)com>, PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: does timestamp precision affect storage size?
Date: 2016-06-21 20:47:43
Message-ID: 5769A7EF.4080208@2ndquadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 21/06/16 22:39, Jonathan Vanasco wrote:
> i'm cleaning up some queries for performance, and noticed that we never use precision beyond the second (ie, `timestamp(0)`) in our business logic.
>
> would there be any savings in storage or performance improvements from losing the resolution on fractional seconds, or are `timestamp(precision)` effectively the same for storage as `timestamp`? (based on docs, I assume the latter but wanted to check)

No, there are no space savings here.

=# select pg_column_size('now'::timestamptz(0)),
pg_column_size('now'::timestamptz);

pg_column_size | pg_column_size
----------------+----------------
8 | 8
(1 row)

--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-06-21 20:50:20 Re: does timestamp precision affect storage size?
Previous Message Jonathan Vanasco 2016-06-21 20:39:59 does timestamp precision affect storage size?