java – PostgreSQL:BYTEA vs OID Large Object?

I started using hibernate 3.2 and PostgreSQL 8.4 applications I have some byte [] fields mapped to @ basic (= PG bytea) and other bytes mapped to @ lob (= PG large object) Why not? Because I am a hibernate noob

These fields now have a maximum of 4 KB (but an average of 2-3 KB) The PostgreSQL document mentions that Lo is good when the field is large, but I don't see the meaning of "large"

I have upgraded to PostgreSQL 9.0 and Hibernate 3.6. I'm stuck changing the comment to @ type (type = "org. Hibernate. Type. Primitivebytearrayblobtype") This bug has raised a potential compatibility problem. I finally found that large objects are a difficult problem compared with normal fields

So I'm considering changing it all to bytea But I worry that byte fields are encoded in hexadecimal, so there are some overhead in encoding and decoding, which will damage performance

Are there any good benchmarks for these two? Someone made a switch. Do you see the difference?

Solution

Byte input can be hexadecimal or escape format, which is your choice Storage will be the same Starting from version 9.0, the default output value is hexadecimal, but you can edit the parameter bytea_ Output to make changes

I don't see any benchmarks

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>