this post was submitted on 18 Jul 2025
795 points (99.4% liked)

Programmer Humor

25111 readers
930 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] lime@feddit.nu 27 points 2 days ago (2 children)

pg can actually query into json fields!

[–] Tanoh@lemmy.world 13 points 2 days ago (1 children)

And you can add indexes on those JSON fields too!

[–] Tja@programming.dev 6 points 1 day ago (2 children)

Kind of. I hope you don't like performance...

[–] jubilationtcornpone@sh.itjust.works 2 points 1 day ago (1 children)

The performance is actually not bad. You're far better off using conventional columns but in the one off cases where you have to store queryable JSON data, it actually performs quite well.

[–] Tja@programming.dev 2 points 1 day ago

Quite well is very subjective. It's much slower than columns or specialized databases like MongoDB.

[–] Tanoh@lemmy.world 1 points 1 day ago

Sure, if you use a field often it is most likely better to extract it into a column with auto-updates from the JSON data.

But you have to tune it and see what is best for your use case. Just saying that you can add indexes to JSON fields as well!

[–] derpgon@programming.dev 3 points 1 day ago (1 children)
[–] lime@feddit.nu 4 points 1 day ago (1 children)

oh i didn't know that. iirc postgres easily beats mongo in json performance which is a bit embarrassing.

[–] derpgon@programming.dev 1 points 1 day ago

Holy, never knew, and never would expect. Postgres truly is king.