4 ms·
In case anyone is looking for a performant way to implement categories like that in Postgres: https://news.ycombinator.com/item?id=33251745 https://news.ycombin
by throwup238 2y ago
In case anyone is looking for a performant way to implement categories like that in Postgres: https://news.ycombinator.com/item?id=33251745 https://news.ycombinator.com/item?id=33251745
I stumbled across that comment a few years back and it changed the way I handle tags and categories so just sharing it here. If anyone has an equivalent for Sqlite, I’d love to hear it!
- wizzwizz4 2y agoIt's a relational database: why not just use a PageCategories table with two foreign keys?
- Twirrim 2y agoThat's what my suggestion came down to. A two column table with company id and category id. They had ids already. They could index off category and get the results in split seconds
- tehlike 2y agopostgres also supports gin indexes, so could do int arrays & contains queries, for example.