One of the core differences between SQL and the relational algebra is that SQL operates over bags whilst the relational algebra operates over sets.
Are there any performance benefits to designing SQL this way? Could a pure relational algebra which operates strictly over sets ever compete with SQL on performance? For which relational operators is ensuring uniqueness of rows expensive?
Performance here means strictly the amount of time it takes to execute queries.