Hacker Newsnew | comments | show | ask | jobs | submit login

Arrays in postgres are incredibly useful for some things. For instance if you use gist or gin index (I forget which), you can do fast intersection queries on arrays.

This is really useful if you want to do something like get all the posts with a certain set of tags: `select posts.tags && ARRAY['postgres', 'arrays']`.

It's also useful for implementing things like materialized paths if you're modeling hierarchies, or adjacency lists if you're modeling graphs I suppose.

Of course all of this could be done with small join tables, but the array intersection / set syntax gives you some nice tools.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: