Earlier quoted context omitted.
ctid gives me ptsd !
ya. i use them when I need to delete duplicates and there is no pk.
Postgres Insider Terminology
21–30 of 36 posts
Re: Postgres Insider Terminology
#22Re: Postgres Insider Terminology
#23Re: Postgres Insider Terminology
#24Earlier quoted context omitted.
so true for almost every sql database? or not?
I think it is true for every row-oriented database that stores all the values for a single row together within a fixed-sized structure. Columnar stores on the other hand may or may not do this. I have built a database engine that is a columnar store. All the values for each column are stored together. This requires just about every query to fetch each row value separately, but it has proven to be incredibly fast. Que…
Re: Postgres Insider Terminology
#25One term that doesn't seem "insider" but kinda is: `timestamptz`, aka the thing you should always use instead of just `timestamp`. The full name is "timestamp with time zone," but contrary to what most people would assume, it doesn't store a time zone.
Re: Postgres Insider Terminology
#26One term that doesn't seem "insider" but kinda is: `timestamptz`, aka the thing you should always use instead of just `timestamp`. The full name is "timestamp with time zone," but contrary to what most people would assume, it doesn't store a time zone.
Could you expand on why timestamptz is preferable to timestamp? What does it additionally store?
Re: Postgres Insider Terminology
#27One term that doesn't seem "insider" but kinda is: `timestamptz`, aka the thing you should always use instead of just `timestamp`. The full name is "timestamp with time zone," but contrary to what most people would assume, it doesn't store a time zone.
Could you expand on why timestamptz is preferable to timestamp? What does it additionally store?
I think you also need it for converting input at specified time zones, which is more complicated than one might hope, using AT TIME ZONE.
So the point is about conversion, which is important, but I agree that it’s non-obvious that you need to store the source time zone separately if you ever want to retrieve it.
[0]: https://www.postgresql.org/docs/current/datatype-datetime.ht...
Re: Postgres Insider Terminology
#28Earlier quoted context omitted.
Could you expand on why timestamptz is preferable to timestamp? What does it additionally store?
`timestamptz` stores the same data I believe. Only that when using `timestamptz` instead of `timestamp`, the server will convert the returned value based on the server time zone configuration. Both datatypes have 8 bytes.
So unless you are using the sql result verbatim as presentation layer, is there any big benefit of this? On the contrary it seems like yet another moving part one could mess up and accidentally convert time where it shouldn’t?
Re: Postgres Insider Terminology
#29Earlier quoted context omitted.
I think it is true for every row-oriented database that stores all the values for a single row together within a fixed-sized structure. Columnar stores on the other hand may or may not do this. I have built a database engine that is a columnar store. All the values for each column are stored together. This requires just about every query to fetch each row value separately, but it has proven to be incredibly fast. Que…
Most columnar stores I'm aware of are hybrid, so all columns of a row are still colocated in the same page.
Re: Postgres Insider Terminology
#30When studying the internals of Postgres years ago, I learned that pages could greatly affect the disk space required to hold a table. If the page size was 8192 bytes (the default) and if the schema defined each row as holding 4097 bytes, then two rows would not fit within a single page. This would cause every row to be within its own page and would waste almost half of the space. Anyone know if this is still true?
Only slightly related, but the biggest increase in space I saw was after transitioning my 1.8 TB Postgres database to ZFS, which has compression turned on by default. Afterwards, the size needed was 310 GB, with no noticeable loss in speed.