Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Don’t call RANDOM() on large tables #647
Spending close to 40% of time executing queries with
Instead we can figure out the largest possible ID, generate an ID between 1 and that number then find a record greater than or equal to that ID.
Here’s the current query with
Here’s the same query with
Much better 0.039ms