6 ms·
Sets and bags are trivially interconvertible so it's really not a big deal: https://h2.jaguarpaw.co.uk/posts/set-bag-irrelevance/ https://h2.jaguarpaw.co.uk/pos
by tome 29d ago
Sets and bags are trivially interconvertible so it's really not a big deal: https://h2.jaguarpaw.co.uk/posts/set-bag-irrelevance/ https://h2.jaguarpaw.co.uk/posts/set-bag-irrelevance/
- ModernMech 29d agoThe point is if you're doing relational algebra you want to work with relations. The key reason why set semantics are nice is because the operations are guaranteed to return relations, so you don't have to check or make accountings of which return values are sets and which are bags, or worry about machinery to convert between the two. It's like how you can store numbers internally as floating points or rationals and trivially convert between the two. But if all you ever do is floating point math, you might prefer to store the numbers as floating points rather than rationals and then convert to floating point.
- tome 26d agoI don't think that's actually what one wants in practice from an RDBMS, but if it really is then one can add UNIQUE to all your SQL queries and get it. SQL is not somehow lacking in that regard.