Unofficial Hacker News client - receive Push Notifications on replies.

Why MySQL OR is slower than IN (opens external site)

22 points by millspore 2 days ago | www.percona.com | 14 comments on HN | Vote on HN (opens Hacker News)

View full thread · View on Hacker News

Comment thread (2)

  1. Damn. After working 1.5 years with MySQL, I wonder if there is anything good with that database server.

    My favorite thing to hate though is still locking and non-locking reads in REPEATABLE READ. Even if it’s documented, it still doesn’t make it right.

    > It is not recommended to mix locking statements (UPDATE, INSERT, DELETE, or SELECT ... FOR ...) with non-locking SELECT statements in a single REPEATABLE READ transaction, because typically in such cases you want SERIALIZABLE. This is because a non-locking SELECT statement presents the state of the database from a read view which consists of transactions committed before the read view was created, and before the current transaction's own writes, while the locking statements use the most recent state of the database to use locking. In general, these two different table states are inconsistent with each other and difficult to parse.

    Replies (1)
    1. The query planner is relatively straightforward and performance optimisations are commonly not derived from as complex reasoning as required when using Postgres or SQL Server.

      The Galera-clustering the company behind TFA provides is pretty simple to set up as well, at least if you're good with Linux and systemd.