4 ms·
SQL and a JOIN? Not what you asked for (and certainly not what the cool kids use), but why not?
by JimmyL 17y ago
SQL and a JOIN?
Not what you asked for (and certainly not what the cool kids use), but why not?
- joshu 17y agotags + sql = bad
- silentbicycle 17y agoCould you expand on that? Searching for the intersection of a set of tags' references seems like the epitome of a set/relational operation to me.
- joshu 17y agoYou want an inverted index. Finding intersections with tags are multi-way joins, which are painful as all hell. At least on MySQL. Perhaps other databases do better. Note that I built probably the biggest platform of this type around.
- gojomo 17y agoSo the tags are terms, and each 'document' is... - a target (such as an URL in delicious)? - a [target, user] pairing? - a [target, user, tagging-event] tuple? Would you recommend using any of the off-the-shelf open-source inverted-index implementations? (Lucene, ferret, sphinx, [hyper]estraier, etc.?)
- joshu 17y agoIt depends on what you need, obviously. I think Lucene or Sphinx will take you a lot of the way. I don't know about the others.
- russell 17y agoThis is a very reasonable solution. The field is mature and performant with good open source solutions like MySQL and Postgres. Look elsewhere only if you have monster scalability issues, many distributed nodes, oddball requirements, or you just want to learn. Edit: oddball requirements == things that relational databases dont do well like text.