Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2024-05-20 Thread Jakub Wartak
On Tue, May 14, 2024 at 8:19 PM Robert Haas  wrote:
>
> I looked at your version and wrote something that is shorter and
> doesn't touch any existing text. Here it is.

Hi Robert, you are a real tactician here - thanks for whatever
references the original problem! :) Maybe just slight hint nearby
expensive (to me indicating a just a CPU problem?):

finding an OID that is still free can become expensive ->
finding an OID that is still free can become expensive, thus
significantly increasing INSERT/UPDATE response time.

? (this potentially makes it easier in future to pinpoint the user's
problem to the this exact limitation; but feel free to ignore that too
as I'm not attached to any of those versions)

-J.




Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2024-05-14 Thread Robert Haas
On Wed, Apr 3, 2024 at 4:59 AM Jakub Wartak
 wrote:
> Yes; I've forgotten about this one and clearly I had problems
> formulating it in proper shape to be accepted. I've moved it to the
> next CF now as this is not critical and I would prefer to help current
> timesenistive CF. Anyone is welcome to help amend the patch...

I looked at your version and wrote something that is shorter and
doesn't touch any existing text. Here it is.

-- 
Robert Haas
EDB: http://www.enterprisedb.com


toastlimit.patch
Description: Binary data


Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2024-04-03 Thread Jakub Wartak
Hi Andrey,

On Thu, Mar 28, 2024 at 1:09 PM Andrey M. Borodin  wrote:
>
>
>
> > On 8 Aug 2023, at 12:31, John Naylor  wrote:
> >
> > > > Also the shared counter is the cause of the slowdown, but not the 
> > > > reason for the numeric limit.
> > >
> > > Isn't it both? typedef Oid is unsigned int = 2^32, and according to 
> > > GetNewOidWithIndex() logic if we exhaust the whole OID space it will hang 
> > > indefinitely which has the same semantics as "being impossible"/permanent 
> > > hang (?)
> >
> > Looking again, I'm thinking the OID type size is more relevant for the 
> > first paragraph, and the shared/global aspect is more relevant for the 
> > second.
> >
> > The last issue is how to separate the notes at the bottom, since there are 
> > now two topics.
>
> Jakub, do you have plans to address this feedback? Is the CF entry still 
> relevant?

Yes; I've forgotten about this one and clearly I had problems
formulating it in proper shape to be accepted. I've moved it to the
next CF now as this is not critical and I would prefer to help current
timesenistive CF. Anyone is welcome to help amend the patch...

-J.




Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2024-03-28 Thread Andrey M. Borodin



> On 8 Aug 2023, at 12:31, John Naylor  wrote:
> 
> > > Also the shared counter is the cause of the slowdown, but not the reason 
> > > for the numeric limit.
> >
> > Isn't it both? typedef Oid is unsigned int = 2^32, and according to 
> > GetNewOidWithIndex() logic if we exhaust the whole OID space it will hang 
> > indefinitely which has the same semantics as "being impossible"/permanent 
> > hang (?)
> 
> Looking again, I'm thinking the OID type size is more relevant for the first 
> paragraph, and the shared/global aspect is more relevant for the second.
> 
> The last issue is how to separate the notes at the bottom, since there are 
> now two topics.

Jakub, do you have plans to address this feedback? Is the CF entry still 
relevant?

Thanks!


Best regards, Andrey Borodin.



Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-08-22 Thread John Naylor
On Mon, Aug 21, 2023 at 1:33 PM Gurjeet Singh  wrote:
>
> Please see attached the proposed patch, which attempts to make that
> language newcomer-friendly. The patch adds one link for TOAST, and
> replaces Postgres-specific terms with generic ones.

This is off-topic for this thread (which has a CF entry), and overall I
don't find the changes to be an improvement. (It wouldn't hurt to link to
the TOAST section, though.)

--
John Naylor
EDB: http://www.enterprisedb.com


Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-08-21 Thread Gurjeet Singh
On Wed, Apr 26, 2023 at 4:48 AM David Rowley  wrote:
>
> On Sun, 23 Apr 2023, 3:42 am Gurjeet Singh,  wrote:
>>
>> I anticipate that edits to Appendix K Postgres Limits will prompt
>> improving the note in there about the maximum column limit, That note
>> is too wordy, and sometimes confusing, especially for the audience
>> that it's written for: newcomers to Postgres ecosystem.
>
>
> I doubt it, but feel free to submit a patch yourself which improves it 
> without losing the information which the paragraph is trying to convey.

I could not think of a way to reduce the wordiness without losing
information. But since this page is usually consulted by those who are
new to Postgres, usually sent here by a search engine, I believe the
page can be improved for that audience, without losing much in terms
of accuracy.

I agree the information provided in the paragraph about max-columns is
pertinent. But since the limits section is most often consulted by
people migrating from other database systems (hence the claim that
they're new to the Postgres ecosystem), I imagine the terminology used
there may cause confusion for the reader. So my suggestion is to make
that paragraph, and perhaps even that page, use fewer hacker/internals
terms.

Technically, there may be a difference between table vs. relation, row
vs. tuple, and column vs. field. But using those terms, seemingly
interchangeably on that page does not help the reader. The page
neither describes the terms, nor links to their definitions, so a
reader is left with more questions than before. For example,

> rows per table:: limited by the number of tuples that can fit onto 
> 4,294,967,295 pages

A newcomer> what's a tuple in this context, and how is it similar
to/different from a row?

Please see attached the proposed patch, which attempts to make that
language newcomer-friendly. The patch adds one link for TOAST, and
replaces Postgres-specific terms with generic ones.

PS: I've retained line boundaries, so that `git diff --color-words
doc/src/sgml/limits.sgml` would make it easy to see the changes.

Best regards,
Gurjeet
http://Gurje.et


limits-generic-terms.diff
Description: Binary data


Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-08-08 Thread John Naylor
On Wed, Jul 5, 2023 at 9:45 PM Jakub Wartak 
wrote:

> [v3]

--- a/doc/src/sgml/limits.sgml
+++ b/doc/src/sgml/limits.sgml
@@ -10,6 +10,7 @@
   hard limits are reached.
  

+
  

@@ -92,11 +93,25 @@
  can be increased by recompiling
PostgreSQL
 

-   
-partition keys
-32
-can be increased by recompiling
PostgreSQL
-   
+
+ partition keys
+ 32
+ can be increased by recompiling
PostgreSQL
+

Ahem.

> > Also, perhaps the LO entries should be split into a separate patch.
Since they are a special case and documented elsewhere, it's not clear
their limits fit well here. Maybe they could.
>
> Well, but those are *limits* of the engine and they seem to be pretty
widely chosen especially in migration scenarios (because they are the only
ones allowed to store over 1GB). I think we should warn the dangers of
using pg_largeobjects.

I see no argument here against splitting into a separate patch for later.

> > Also the shared counter is the cause of the slowdown, but not the
reason for the numeric limit.
>
> Isn't it both? typedef Oid is unsigned int = 2^32, and according to
GetNewOidWithIndex() logic if we exhaust the whole OID space it will hang
indefinitely which has the same semantics as "being impossible"/permanent
hang (?)

Looking again, I'm thinking the OID type size is more relevant for the
first paragraph, and the shared/global aspect is more relevant for the
second.

The last issue is how to separate the notes at the bottom, since there are
now two topics.

--
John Naylor
EDB: http://www.enterprisedb.com


Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-07-05 Thread Jakub Wartak
On Tue, Jun 13, 2023 at 10:20 AM John Naylor 
wrote:

Hi John,

v3 is attached for review.

> >
> >- 
> >+ see note below on TOAST
>
> Maybe:
> "further limited by the number of TOAST-ed values; see note below"

Fixed.

> > I've wrongly put it, I've meant that pg_largeobject also consume OID
> > and as such are subject to 32TB limit.
> No, OID has nothing to do with the table size limit, they have to do with
the max number of LOs in a DB.

Clearly I needed more coffee back then...

> Also, perhaps the LO entries should be split into a separate patch. Since
they are a special case and documented elsewhere, it's not clear their
limits fit well here. Maybe they could.

Well, but those are *limits* of the engine and they seem to be pretty
widely chosen especially in migration scenarios (because they are the only
ones allowed to store over 1GB). I think we should warn the dangers of
using pg_largeobjects.

> > + 
> > +  For every TOAST-ed column (that is for field values wider than
TOAST_TUPLE_TARGET
> > +  [2040 bytes by default]), due to internal PostgreSQL implementation
of using one
> > +  shared global OID counter - today you cannot have more than
4,294,967,296 out-of-line
> > +  values in a single table.
> > + 
> > +
> > + 

> "column" != "field value". (..)"Today" is irrelevant. Needs polish.

Fixed.

> Also the shared counter is the cause of the slowdown, but not the reason
for the numeric limit.

Isn't it both? typedef Oid is unsigned int = 2^32, and according to
GetNewOidWithIndex() logic if we exhaust the whole OID space it will hang
indefinitely which has the same semantics as "being impossible"/permanent
hang (?)

> +  out-of-line value (The search for free OIDs won't stop until it finds
the free OID).

> Still too much detail, and not very illuminating. If it *did* stop, how
does that make it any less of a problem?

OK I see your point - so it's removed. As for the question: well, maybe we
could document that one day in known-performance-cliffs.sgml (or via Wiki)
instead of limits.sgml.

> +  Therefore, the OID shortages will eventually cause slowdowns to the
> +  INSERTs/UPDATE/COPY statements.

> Maybe this whole sentence is better as "This will eventually cause
slowdowns for INSERT, UPDATE, and COPY statements."

Yes, it flows much better that way.

> > > +  Please note that that the limit of 2^32
> > > +  out-of-line TOAST values applies to the sum of both visible and
invisible tuples.
> > >
> > > We didn't feel the need to mention this for normal tuples...
> >
> > Right, but this somewhat points reader to the queue-like scenario
> > mentioned by Nikita.

> That seems to be in response to you mentioning "especially to steer
people away from designing very wide non-partitioned tables". In any case,
I'm now thinking that everything in this sentence and after doesn't belong
here. We don't need to tell people to vacuum, and we don't need to tell
them about partitioning as a workaround -- it's a workaround for the table
size limit, too, but we are just documenting the limits here.

OK, I've removed the visible/invisible fragments and workaround techniques.

-J.


v3-0001-doc-Add-some-OID-TOAST-related-limitations-to-the.patch
Description: Binary data


Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-06-13 Thread John Naylor
On Thu, Apr 27, 2023 at 7:36 PM Jakub Wartak 
wrote:

> > Spurious whitespace.
>
> Hopefully fixed, I've tried to align with the other entries tags.

Hope springs eternal. ;-)

--- a/doc/src/sgml/limits.sgml
+++ b/doc/src/sgml/limits.sgml
@@ -10,6 +10,7 @@
   hard limits are reached.
  

+
  

@@ -92,11 +93,24 @@
  can be increased by recompiling
PostgreSQL
 

-   
-partition keys
-32
-can be increased by recompiling
PostgreSQL
-   
+
+ partition keys
+ 32
+ can be increased by recompiling
PostgreSQL
+


- 
+ see note below on TOAST

Maybe:

"further limited by the number of TOAST-ed values; see note below"

> > +   
> > + large objects size
> > + subject to the same limitations as single relation
size
> > + LOs are stored in single pg_largeobjects relation
> > +   
> >
> > Are you under the impression that we can store a single large object up
to table size? The limit is 4TB, as documented elsewhere.
>
> I've wrongly put it, I've meant that pg_largeobject also consume OID
> and as such are subject to 32TB limit.

No, OID has nothing to do with the table size limit, they have to do with
the max number of LOs in a DB.

Also, perhaps the LO entries should be split into a separate patch. Since
they are a special case and documented elsewhere, it's not clear their
limits fit well here. Maybe they could.

+ 
+  For every TOAST-ed column (that is for field values wider than
TOAST_TUPLE_TARGET
+  [2040 bytes by default]), due to internal PostgreSQL implementation of
using one
+  shared global OID counter - today you cannot have more than
4,294,967,296 out-of-line
+  values in a single table.
+ 
+
+ 

"column" != "field value". Also the shared counter is the cause of the
slowdown, but not the reason for the numeric limit. "Today" is irrelevant.
Needs polish.

> > + After 100 failed attempts to get a free OID, a first log
> > +  message is emitted "still searching for an unused OID in relation",
but operation
> > +  won't stop and will try to continue until it finds the free OID.
> >
> > Too much detail?
>
> OK - partially removed.

+  out-of-line value (The search for free OIDs won't stop until it finds
the free OID).

Still too much detail, and not very illuminating. If it *did* stop, how
does that make it any less of a problem?

+  Therefore, the OID shortages will eventually cause slowdowns to the
+  INSERTs/UPDATE/COPY statements.

Maybe this whole sentence is better as

"This will eventually cause slowdowns for INSERT, UPDATE, and COPY
statements."

> > +  Please note that that the limit of 2^32
> > +  out-of-line TOAST values applies to the sum of both visible and
invisible tuples.
> >
> > We didn't feel the need to mention this for normal tuples...
>
> Right, but this somewhat points reader to the queue-like scenario
> mentioned by Nikita.

That seems to be in response to you mentioning "especially to steer people
away from designing very wide non-partitioned tables". In any case, I'm now
thinking that everything in this sentence and after doesn't belong here. We
don't need to tell people to vacuum, and we don't need to tell them about
partitioning as a workaround -- it's a workaround for the table size limit,
too, but we are just documenting the limits here.

--
John Naylor
EDB: http://www.enterprisedb.com


Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-04-27 Thread Jakub Wartak
Hi John,

Thanks for your review. Here's v2 attached.

> -partition keys
> -32
> -can be increased by recompiling 
> PostgreSQL
> + partition keys
> + 32
> + can be increased by recompiling 
> PostgreSQL
>
> Spurious whitespace.

Hopefully fixed, I've tried to align with the other entries tags.

> - limited by the number of tuples that can fit onto 4,294,967,295 
> pages
> - 
> + limited by the number of tuples that can fit onto 4,294,967,295 
> pages or using up to 2^32 OIDs for TOASTed values
> + please see discussion below about OIDs
>
> I would keep the first as is, and change the second for consistency to "see 
> note below on TOAST".

Fixed.

> Also, now that we have more than one note, we should make them more separate. 
> That's something to discuss, no need to do anything just yet.

OK.

> The new note needs a lot of editing to fit its new home. For starters:
>
> + 
> +  For every TOAST-ed columns
>
> column

Fixed.

> + (that is for field values wider than TOAST_TUPLE_TARGET
> +  [2040 bytes by default]), due to internal PostgreSQL implementation of 
> using one
> +  shared global OID counter - today you cannot have more than
>
> + 2^32
>
> Perhaps it should match full numbers elsewhere in the page.

Fixed.

>
> +(unsigned integer;
>
> True but irrelevant.
>
> +  4 billion)
>
> Imprecise and redundant.

Removed both.

> + out-of-line values in a single table, because there would have to be
> +  duplicated OIDs in its TOAST table.
>
> The part after "because" should be left off.

Removed.

> +  Please note that that the limit of 2^32
> +  out-of-line TOAST values applies to the sum of both visible and invisible 
> tuples.
>
> We didn't feel the need to mention this for normal tuples...

Right, but this somewhat points reader to the queue-like scenario
mentioned by Nikita.

> +  It is therefore crucial that the autovacuum manages to keep up with 
> cleaning the
> +  bloat and free the unused OIDs.
> + 
>
> Out of place.

I have somewhat reworded it, again just to reference to the above.

> + 
> +  In practice, you want to have considerably less than that many TOASTed 
> values
> +  per table, because as the OID space fills up the system might spend large
> +  amounts of time searching for the next free OID when it needs to generate 
> a new
> +  out-of-line value.
>
> s/might spend large/will spend larger/ ?

Fixed.

> + After 100 failed attempts to get a free OID, a first log
> +  message is emitted "still searching for an unused OID in relation", but 
> operation
> +  won't stop and will try to continue until it finds the free OID.
>
> Too much detail?

OK - partially removed.

> + Therefore,
> +  the OID shortages may (in very extreme cases) cause slowdowns to the
> +  INSERTs/UPDATE/COPY statements.
>
> s/may (in very extreme cases)/will eventually/

Fixed.

> + It's also worth emphasizing that
>
> Unnecessary.

Removed.

> + only field
> +  values wider than 2KB
>
> TOAST_TUPLE_TARGET

Good catch, fixed.

> + will consume TOAST OIDs in this way. So, in practice,
> +  reaching this limit would require many terabytes of data in a single table,
>
> It may be worth mentioning what Nikita said above about updates.

I've tried (with the above statement with visible and invisible tuples).

> +  especially if you have a wide range of value widths.
>
> I never understood this part.

I've changed it, but I wonder if the new "large number of wide
columns" isn't too ambiguous due to "large" (?)

> +   
> + large objects size
> + subject to the same limitations as single relation 
> size
> + LOs are stored in single pg_largeobjects relation
> +   
>
> Are you under the impression that we can store a single large object up to 
> table size? The limit is 4TB, as documented elsewhere.

I've wrongly put it, I've meant that pg_largeobject also consume OID
and as such are subject to 32TB limit.

>
> +   
> + large objects number
>
> "large objects per database"

Fixed.

> + subject to the same limitations as rows per 
> table
>
> That implies table size is the only factor. Max OID is also a factor, which 
> was your stated reason to include LOs here in the first place.

Exactly..

Regards,
-Jakub Wartak.


v2-0001-doc-Add-some-OID-TOAST-related-limitations-to-the.patch
Description: Binary data


Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-04-26 Thread John Naylor
On Wed, Apr 26, 2023 at 5:18 PM Jakub Wartak 
wrote:

> OK, so here is the documentation patch proposal. I've also added two
> rows touching the subject of pg_largeobjects, as it is also related to
> the OIDs topic.

-partition keys
-32
-can be increased by recompiling
PostgreSQL
+ partition keys
+ 32
+ can be increased by recompiling
PostgreSQL

Spurious whitespace.

- limited by the number of tuples that can fit onto
4,294,967,295 pages
- 
+ limited by the number of tuples that can fit onto
4,294,967,295 pages or using up to 2^32 OIDs for TOASTed values
+ please see discussion below about OIDs

I would keep the first as is, and change the second for consistency to "see
note below on TOAST".

Also, now that we have more than one note, we should make them more
separate. That's something to discuss, no need to do anything just yet.

The new note needs a lot of editing to fit its new home. For starters:

+ 
+  For every TOAST-ed columns

column

+ (that is for field values wider than TOAST_TUPLE_TARGET
+  [2040 bytes by default]), due to internal PostgreSQL implementation of
using one
+  shared global OID counter - today you cannot have more than

+ 2^32

Perhaps it should match full numbers elsewhere in the page.

+(unsigned integer;

True but irrelevant.

+  4 billion)

Imprecise and redundant.

+ out-of-line values in a single table, because there would have to be
+  duplicated OIDs in its TOAST table.

The part after "because" should be left off.

+  Please note that that the limit of 2^32
+  out-of-line TOAST values applies to the sum of both visible and
invisible tuples.

We didn't feel the need to mention this for normal tuples...

+  It is therefore crucial that the autovacuum manages to keep up with
cleaning the
+  bloat and free the unused OIDs.
+ 

Out of place.

+ 
+  In practice, you want to have considerably less than that many TOASTed
values
+  per table, because as the OID space fills up the system might spend large
+  amounts of time searching for the next free OID when it needs to
generate a new
+  out-of-line value.

s/might spend large/will spend larger/ ?

+ After 100 failed attempts to get a free OID, a first log
+  message is emitted "still searching for an unused OID in relation", but
operation
+  won't stop and will try to continue until it finds the free OID.

Too much detail?

+ Therefore,
+  the OID shortages may (in very extreme cases) cause slowdowns to the
+  INSERTs/UPDATE/COPY statements.

s/may (in very extreme cases)/will eventually/

+ It's also worth emphasizing that

Unnecessary.

+ only field
+  values wider than 2KB

TOAST_TUPLE_TARGET

+ will consume TOAST OIDs in this way. So, in practice,
+  reaching this limit would require many terabytes of data in a single
table,

It may be worth mentioning what Nikita said above about updates.

+  especially if you have a wide range of value widths.

I never understood this part.

+   
+ large objects size
+ subject to the same limitations as single relation
size
+ LOs are stored in single pg_largeobjects relation
+   

Are you under the impression that we can store a single large object up to
table size? The limit is 4TB, as documented elsewhere.

+   
+ large objects number

"large objects per database"

+ subject to the same limitations as rows per
table

That implies table size is the only factor. Max OID is also a factor, which
was your stated reason to include LOs here in the first place.

+ LOs are stored in single pg_largeobjects relation

I would just say "also limited by relation size".

(note: Our catalogs are named in the singular.)

--
John Naylor
EDB: http://www.enterprisedb.com


Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-04-26 Thread David Rowley
On Sun, 23 Apr 2023, 3:42 am Gurjeet Singh,  wrote:

> I anticipate that edits to Appendix K Postgres Limits will prompt
> improving the note in there about the maximum column limit, That note
> is too wordy, and sometimes confusing, especially for the audience
> that it's written for: newcomers to Postgres ecosystem.
>

I doubt it, but feel free to submit a patch yourself which improves it
without losing the information which the paragraph is trying to convey.

David

>


Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-04-26 Thread Jakub Wartak
Hi,

>> These 2 discussions show that it's a painful experience to run into
>> this problem, and that the hackers have ideas on how to fix it, but
>> those fixes haven't materialized for years. So I would say that, yes,
>> this info belongs in the hard-limits section, because who knows how
>> long it'll take this to be fixed.
>>
>> Please submit a patch.
>>
> This is a production case for large databases with high update rates, but is 
> mistaken
> with reaching table size limit, although size limit is processed correctly.
>
> The note on TOAST limitation does not mention that TOAST values are not 
> actually
> updated on UPDATE operation - old value is marked as dead and new one is 
> inserted,
> and dead values should be vacuumed before value OID could be reused. The worst
> is that the INSERT/UPDATE clause does not fail if there is no OID available - 
> it is
> looped in an infinite loop of sorting out OIDs.

OK, so here is the documentation patch proposal. I've also added two
rows touching the subject of pg_largeobjects, as it is also related to
the OIDs topic. Please feel free to send adjusted patches.

Regards,
-J.


v1-0001-doc-Add-some-OID-TOAST-related-limitations-to-the.patch
Description: Binary data


Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-04-24 Thread Nikita Malakhov
Hi,

This is a production case for large databases with high update rates, but
is mistaken
with reaching table size limit, although size limit is processed correctly.

The note on TOAST limitation does not mention that TOAST values are not
actually
updated on UPDATE operation - old value is marked as dead and new one is
inserted,
and dead values should be vacuumed before value OID could be reused. The
worst
is that the INSERT/UPDATE clause does not fail if there is no OID available
- it is
looped in an infinite loop of sorting out OIDs.

On Sat, Apr 22, 2023 at 6:42 PM Gurjeet Singh  wrote:

> On Fri, Apr 21, 2023 at 12:14 AM Nikita Malakhov 
> wrote:
> > This limitation applies not only to wide tables - it also applies to
> tables where TOASTed values
> > are updated very often. You would soon be out of available TOAST value
> ID because in case of
> > high frequency updates autovacuum cleanup rate won't keep up with the
> updates. It is discussed
> > in [1].
> >
> > On Fri, Apr 21, 2023 at 9:39 AM Jakub Wartak <
> jakub.war...@enterprisedb.com> wrote:
> >> I would like to ask if it wouldn't be good idea to copy the
> >> https://wiki.postgresql.org/wiki/TOAST#Total_table_size_limit
> >> discussion (out-of-line OID usage per TOAST-ed columns / potential
> >> limitation) to the official "Appendix K. PostgreSQL Limits" with also
> >> little bonus mentioning the "still searching for an unused OID in
> >> relation" notice. Although it is pretty obvious information for some
> >> and from commit 7fbcee1b2d5f1012c67942126881bd492e95077e and the
> >> discussion in [1], I wonder if the information shouldn't be a little
> >> more well known via the limitation (especially to steer people away
> >> from designing very wide non-partitioned tables).
> >>
> >> [1] -
> https://www.postgresql.org/message-id/flat/16722-93043fb459a41073%40postgresql.org
> >
> > [1]
> https://www.postgresql.org/message-id/CAN-LCVPRvRzxeUdYdDCZ7UwZQs1NmZpqBUCd%3D%2BRdMPFTyt-bRQ%40mail.gmail.com
>
> These 2 discussions show that it's a painful experience to run into
> this problem, and that the hackers have ideas on how to fix it, but
> those fixes haven't materialized for years. So I would say that, yes,
> this info belongs in the hard-limits section, because who knows how
> long it'll take this to be fixed.
>
> Please submit a patch.
>
> I anticipate that edits to Appendix K Postgres Limits will prompt
> improving the note in there about the maximum column limit, That note
> is too wordy, and sometimes confusing, especially for the audience
> that it's written for: newcomers to Postgres ecosystem.
>
> Best regards,
> Gurjeet https://Gurje.et
> http://aws.amazon.com
>


-- 
Regards,
Nikita Malakhov
Postgres Professional
The Russian Postgres Company
https://postgrespro.ru/


Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-04-22 Thread Gurjeet Singh
On Fri, Apr 21, 2023 at 12:14 AM Nikita Malakhov  wrote:
> This limitation applies not only to wide tables - it also applies to tables 
> where TOASTed values
> are updated very often. You would soon be out of available TOAST value ID 
> because in case of
> high frequency updates autovacuum cleanup rate won't keep up with the 
> updates. It is discussed
> in [1].
>
> On Fri, Apr 21, 2023 at 9:39 AM Jakub Wartak  
> wrote:
>> I would like to ask if it wouldn't be good idea to copy the
>> https://wiki.postgresql.org/wiki/TOAST#Total_table_size_limit
>> discussion (out-of-line OID usage per TOAST-ed columns / potential
>> limitation) to the official "Appendix K. PostgreSQL Limits" with also
>> little bonus mentioning the "still searching for an unused OID in
>> relation" notice. Although it is pretty obvious information for some
>> and from commit 7fbcee1b2d5f1012c67942126881bd492e95077e and the
>> discussion in [1], I wonder if the information shouldn't be a little
>> more well known via the limitation (especially to steer people away
>> from designing very wide non-partitioned tables).
>>
>> [1] - 
>> https://www.postgresql.org/message-id/flat/16722-93043fb459a41073%40postgresql.org
>
> [1] 
> https://www.postgresql.org/message-id/CAN-LCVPRvRzxeUdYdDCZ7UwZQs1NmZpqBUCd%3D%2BRdMPFTyt-bRQ%40mail.gmail.com

These 2 discussions show that it's a painful experience to run into
this problem, and that the hackers have ideas on how to fix it, but
those fixes haven't materialized for years. So I would say that, yes,
this info belongs in the hard-limits section, because who knows how
long it'll take this to be fixed.

Please submit a patch.

I anticipate that edits to Appendix K Postgres Limits will prompt
improving the note in there about the maximum column limit, That note
is too wordy, and sometimes confusing, especially for the audience
that it's written for: newcomers to Postgres ecosystem.

Best regards,
Gurjeet https://Gurje.et
http://aws.amazon.com




Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-04-21 Thread Nikita Malakhov
Hi!

This limitation applies not only to wide tables - it also applies to tables
where TOASTed values
are updated very often. You would soon be out of available TOAST value ID
because in case of
high frequency updates autovacuum cleanup rate won't keep up with the
updates. It is discussed
in [1].


On Fri, Apr 21, 2023 at 9:39 AM Jakub Wartak 
wrote:

> Hi -hackers,
>
> I would like to ask if it wouldn't be good idea to copy the
> https://wiki.postgresql.org/wiki/TOAST#Total_table_size_limit
> discussion (out-of-line OID usage per TOAST-ed columns / potential
> limitation) to the official "Appendix K. PostgreSQL Limits" with also
> little bonus mentioning the "still searching for an unused OID in
> relation" notice. Although it is pretty obvious information for some
> and from commit 7fbcee1b2d5f1012c67942126881bd492e95077e and the
> discussion in [1], I wonder if the information shouldn't be a little
> more well known via the limitation (especially to steer people away
> from designing very wide non-partitioned tables).
>
> Regards,
> -J.
>
> [1] -
> https://www.postgresql.org/message-id/flat/16722-93043fb459a41073%40postgresql.org
>
>
>
[1]
https://www.postgresql.org/message-id/CAN-LCVPRvRzxeUdYdDCZ7UwZQs1NmZpqBUCd%3D%2BRdMPFTyt-bRQ%40mail.gmail.com

--
Regards,
Nikita Malakhov
Postgres Professional
The Russian Postgres Company
https://postgrespro.ru/


Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-04-21 Thread Jakub Wartak
Hi -hackers,

I would like to ask if it wouldn't be good idea to copy the
https://wiki.postgresql.org/wiki/TOAST#Total_table_size_limit
discussion (out-of-line OID usage per TOAST-ed columns / potential
limitation) to the official "Appendix K. PostgreSQL Limits" with also
little bonus mentioning the "still searching for an unused OID in
relation" notice. Although it is pretty obvious information for some
and from commit 7fbcee1b2d5f1012c67942126881bd492e95077e and the
discussion in [1], I wonder if the information shouldn't be a little
more well known via the limitation (especially to steer people away
from designing very wide non-partitioned tables).

Regards,
-J.

[1] - 
https://www.postgresql.org/message-id/flat/16722-93043fb459a41073%40postgresql.org