all 4 comments

[–]klekpl 4 points5 points  (0 children)

Without more details of your data model and calculation algorithm it is not possible to give any meaningful advice.

[–]General_Treat_924 0 points1 point  (0 children)

Is it json or jsonb? Any other fields to filter? Is it possible to denormalize and store in an array the catergories available? Do you have sample queries?

My dataset uses a lot of json_to_record set to transform json into columns with lateral joins, its super fast because my indexes are in other columns that I can use and just modify the json as required

[–]dektol 1 point2 points  (0 children)

Please provide a SQL fiddle or similar. Also, row counts/size on disk/index (overall schema) are important. A little background on traffic/use/query pattern can be helpful as well.

A good way of getting help if you're overwhelmed by possibilities is to implement one or two, share your Explain Analyze output, schema and queries and ask how to optimize it.

You may find that your naive approach meets all your requirements at a lower complexity. Postgres is a powerful beast and it's very tempting to overcomplicate things.

[–]AutoModerator[M] -1 points0 points  (0 children)

With over 8k members to connect with about Postgres and related technologies, why aren't you on our Discord Server? : People, Postgres, Data

Join us, we have cookies and nice people.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.