pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to get more than 2^32 BLOBs
6+ messages / 3 participants
[nested] [flat]

* How to get more than 2^32 BLOBs
@ 2020-04-08 09:15 Donato Marrazzo <donato.marrazzo@gmail.com>
  2020-04-08 10:06 ` Re: How to get more than 2^32 BLOBs Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 6+ messages in thread

From: Donato Marrazzo @ 2020-04-08 09:15 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hi all,

according this page [1], large object are limited to the OID range of 2^32
(since it's a 4 bytes number).
I'm working on a use case were there are many tables with blobs (on
average not so large 32KB).
I foresee that in 2-3 years time frame, the limit of overall blobs will be
breached: more than 2^32 blobs.

- Is there a way to change the OID limit?
- Should we switch to a bytea implementation?
- Are there any drawback of bytea except the maximum space?

Thank you!

All the best,
Donato

[1]:
https://www.microolap.com/products/connectivity/postgresdac/help/tipsandtricks_byteavsoid.htm

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How to get more than 2^32 BLOBs
  2020-04-08 09:15 How to get more than 2^32 BLOBs Donato Marrazzo <donato.marrazzo@gmail.com>
@ 2020-04-08 10:06 ` Laurenz Albe <laurenz.albe@cybertec.at>
  2020-04-08 10:12   ` Re: How to get more than 2^32 BLOBs Donato Marrazzo <donato.marrazzo@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Laurenz Albe @ 2020-04-08 10:06 UTC (permalink / raw)
  To: Donato Marrazzo <donato.marrazzo@gmail.com>; pgsql-admin@lists.postgresql.org

On Wed, 2020-04-08 at 11:15 +0200, Donato Marrazzo wrote:
> according this page [1], large object are limited to the OID range of 2^32 (since it's a 4 bytes number).
> I'm working on a use case were there are many tables with blobs (on average not so large 32KB).
> I foresee that in 2-3 years time frame, the limit of overall blobs will be breached: more than 2^32 blobs.
> 
> - Is there a way to change the OID limit?
> - Should we switch to a bytea implementation?
> - Are there any drawback of bytea except the maximum space?

Don't use large objects.  They are only useful if
1) you have files larger than 1GB or
2) you need to stream writes

There are no such limitations if you use the "bytea" data type, and it is
much simpler to handle at the same time.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How to get more than 2^32 BLOBs
  2020-04-08 09:15 How to get more than 2^32 BLOBs Donato Marrazzo <donato.marrazzo@gmail.com>
  2020-04-08 10:06 ` Re: How to get more than 2^32 BLOBs Laurenz Albe <laurenz.albe@cybertec.at>
@ 2020-04-08 10:12   ` Donato Marrazzo <donato.marrazzo@gmail.com>
  2020-04-08 11:41     ` Re: How to get more than 2^32 BLOBs Christophe Courtois <christophe.courtois@dalibo.com>
  2020-04-08 12:04     ` Re: How to get more than 2^32 BLOBs Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 2 replies; 6+ messages in thread

From: Donato Marrazzo @ 2020-04-08 10:12 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-admin@lists.postgresql.org

Hi Laurenz,

thank you for your reply.
Are you aware of any performance drawback?

Il giorno mer 8 apr 2020 alle ore 12:06 Laurenz Albe <
laurenz.albe@cybertec.at> ha scritto:

> On Wed, 2020-04-08 at 11:15 +0200, Donato Marrazzo wrote:
> > according this page [1], large object are limited to the OID range of
> 2^32 (since it's a 4 bytes number).
> > I'm working on a use case were there are many tables with blobs (on
> average not so large 32KB).
> > I foresee that in 2-3 years time frame, the limit of overall blobs will
> be breached: more than 2^32 blobs.
> >
> > - Is there a way to change the OID limit?
> > - Should we switch to a bytea implementation?
> > - Are there any drawback of bytea except the maximum space?
>
> Don't use large objects.  They are only useful if
> 1) you have files larger than 1GB or
> 2) you need to stream writes
>
> There are no such limitations if you use the "bytea" data type, and it is
> much simpler to handle at the same time.
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
>

-- 
*Ing. Donato Marrazzo*
*Via Pia Nalli, 101*
*00134 Roma*
*Cell. 335-7446273*

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How to get more than 2^32 BLOBs
  2020-04-08 09:15 How to get more than 2^32 BLOBs Donato Marrazzo <donato.marrazzo@gmail.com>
  2020-04-08 10:06 ` Re: How to get more than 2^32 BLOBs Laurenz Albe <laurenz.albe@cybertec.at>
  2020-04-08 10:12   ` Re: How to get more than 2^32 BLOBs Donato Marrazzo <donato.marrazzo@gmail.com>
@ 2020-04-08 11:41     ` Christophe Courtois <christophe.courtois@dalibo.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Christophe Courtois @ 2020-04-08 11:41 UTC (permalink / raw)
  To: Donato Marrazzo <donato.marrazzo@gmail.com>; Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-admin@lists.postgresql.org

Hi,

Le 08/04/2020 à 12:12, Donato Marrazzo a écrit :
> Hi Laurenz,
> thank you for your reply.
> Are you aware of any performance drawback?

We had a customer with millions of small Large Objects, in part because
his application forgot to unlink them.

As a consequence, pg_dump was using huge amounts of memory, making a
backup impossible. It was with PG 9.5, I don't think the situation
improved since.

> Il giorno mer 8 apr 2020 alle ore 12:06 Laurenz Albe
> <laurenz.albe@cybertec.at <mailto:laurenz.albe@cybertec.at>> ha scritto:
...
>     > I'm working on a use case were there are many tables with blobs
>     (on average not so large 32KB).
>     > I foresee that in 2-3 years time frame, the limit of overall blobs
>     will be breached: more than 2^32 blobs.
>     > - Is there a way to change the OID limit?
>     > - Should we switch to a bytea implementation?
>     > - Are there any drawback of bytea except the maximum space?

>     Don't use large objects.  They are only useful if
>     1) you have files larger than 1GB or
>     2) you need to stream writes
> 
>     There are no such limitations if you use the "bytea" data type, and
>     it is much simpler to handle at the same time.


+1


-- 
Christophe Courtois
Consultant Dalibo
https://dalibo.com/





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How to get more than 2^32 BLOBs
  2020-04-08 09:15 How to get more than 2^32 BLOBs Donato Marrazzo <donato.marrazzo@gmail.com>
  2020-04-08 10:06 ` Re: How to get more than 2^32 BLOBs Laurenz Albe <laurenz.albe@cybertec.at>
  2020-04-08 10:12   ` Re: How to get more than 2^32 BLOBs Donato Marrazzo <donato.marrazzo@gmail.com>
@ 2020-04-08 12:04     ` Laurenz Albe <laurenz.albe@cybertec.at>
  2020-04-08 13:14       ` Re: How to get more than 2^32 BLOBs Donato Marrazzo <donato.marrazzo@gmail.com>
  1 sibling, 1 reply; 6+ messages in thread

From: Laurenz Albe @ 2020-04-08 12:04 UTC (permalink / raw)
  To: Donato Marrazzo <donato.marrazzo@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org

On Wed, 2020-04-08 at 12:12 +0200, Donato Marrazzo wrote:
> 
> Il giorno mer 8 apr 2020 alle ore 12:06 Laurenz Albe <laurenz.albe@cybertec.at> ha scritto:
> > On Wed, 2020-04-08 at 11:15 +0200, Donato Marrazzo wrote:
> > > according this page [1], large object are limited to the OID range of 2^32 (since it's a 4 bytes number).
> > > I'm working on a use case were there are many tables with blobs (on average not so large 32KB).
> > > I foresee that in 2-3 years time frame, the limit of overall blobs will be breached: more than 2^32 blobs.
> > > 
> > > - Is there a way to change the OID limit?
> > > - Should we switch to a bytea implementation?
> > > - Are there any drawback of bytea except the maximum space?
> > 
> > Don't use large objects.  They are only useful if
> > 1) you have files larger than 1GB or
> > 2) you need to stream writes
> > 
> > There are no such limitations if you use the "bytea" data type, and it is
> > much simpler to handle at the same time.
> 
> Are you aware of any performance drawback?

No; in fact, "bytea" performs better.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How to get more than 2^32 BLOBs
  2020-04-08 09:15 How to get more than 2^32 BLOBs Donato Marrazzo <donato.marrazzo@gmail.com>
  2020-04-08 10:06 ` Re: How to get more than 2^32 BLOBs Laurenz Albe <laurenz.albe@cybertec.at>
  2020-04-08 10:12   ` Re: How to get more than 2^32 BLOBs Donato Marrazzo <donato.marrazzo@gmail.com>
  2020-04-08 12:04     ` Re: How to get more than 2^32 BLOBs Laurenz Albe <laurenz.albe@cybertec.at>
@ 2020-04-08 13:14       ` Donato Marrazzo <donato.marrazzo@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Donato Marrazzo @ 2020-04-08 13:14 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-admin@lists.postgresql.org

Hi Laurenz and Christophe,

thank you very much for your great advises.

^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2020-04-08 13:14 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-08 09:15 How to get more than 2^32 BLOBs Donato Marrazzo <donato.marrazzo@gmail.com>
2020-04-08 10:06 ` Laurenz Albe <laurenz.albe@cybertec.at>
2020-04-08 10:12   ` Donato Marrazzo <donato.marrazzo@gmail.com>
2020-04-08 11:41     ` Christophe Courtois <christophe.courtois@dalibo.com>
2020-04-08 12:04     ` Laurenz Albe <laurenz.albe@cybertec.at>
2020-04-08 13:14       ` Donato Marrazzo <donato.marrazzo@gmail.com>

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