Skip to main content
19 events
when toggle format what by license comment
Aug 14, 2023 at 14:21 comment added Akaisteph7 @ErwinBrandstetter I think it's the most useful if all you want to know is the size of the row's content (from DanielVerite's answer below, it seems it does include any toasted content too). If you want to predict the needed size for a table, then it's less helpful but still needed to know how much space indices are taking and all. Overall, very important still. And it's good for the distinction to be clear either ways.
Aug 12, 2023 at 1:33 comment added Erwin Brandstetter @Akaisteph7: Completely depends what you are looking for, exactly. If it's about storage requirements, then the size of the text representation is barely useful.
Aug 11, 2023 at 20:53 comment added Akaisteph7 Note that the live_rows_in_text_representation seems to be the best representation of actual row size. The three above it are more so representations of other table data divided by the number of rows, which is very different. They are more helpful when you have enough rows, but with less than 10 rows for example, those numbers can be very misleading.
Oct 11, 2021 at 20:59 comment added Erwin Brandstetter @Sanandrea: The query runs a sequential scan over the whole table. So, depending on your timeout settings, that might happen if your table is huge, or if there are locking issues ... You might omit ct and txt_len, and provide the table name manually ('public.tbl'::regclass AS tbl ) to get the rest quickly.
Oct 11, 2021 at 15:45 comment added Sanandrea am I in trouble if the first query always times out in my case?
Apr 16, 2021 at 22:34 history edited Erwin Brandstetter CC BY-SA 4.0
markup, format, cleanup
Jun 15, 2020 at 9:05 history edited CommunityBot
Commonmark migration
Feb 29, 2020 at 12:58 history edited Erwin Brandstetter CC BY-SA 4.0
minor edit
Oct 17, 2019 at 23:28 history edited Erwin Brandstetter CC BY-SA 4.0
update links, bring modern query to the top, fix div-by-0, denoise
May 9, 2018 at 10:38 vote accept Joe
May 23, 2017 at 12:40 history edited CommunityBot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Apr 13, 2017 at 12:42 history edited CommunityBot
replaced http://dba.stackexchange.com/ with https://dba.stackexchange.com/
Oct 2, 2015 at 2:18 history edited Erwin Brandstetter CC BY-SA 3.0
typo, unify format
Oct 1, 2015 at 1:17 history edited Erwin Brandstetter CC BY-SA 3.0
add missing answer for 2nd question, add new solution for pg 9.4, add links, clean up
Oct 26, 2012 at 3:43 history edited Erwin Brandstetter CC BY-SA 3.0
add pgstattuple
Oct 6, 2012 at 2:53 history edited Erwin Brandstetter CC BY-SA 3.0
simplify
Oct 6, 2012 at 2:48 history edited Erwin Brandstetter CC BY-SA 3.0
simplify
Sep 8, 2012 at 17:20 history edited Erwin Brandstetter CC BY-SA 3.0
fix links
Sep 8, 2012 at 16:08 history answered Erwin Brandstetter CC BY-SA 3.0