Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug always the same random object on basemodel #1652

Open
wants to merge 1 commit into
base: dev/php8
Choose a base branch
from

Conversation

behnaz-zarriz
Copy link

our server is up to date, but the random object selection method (SELECT CEIL(RAND()) is not working.

This query that I modified now works because it first selects random IDs using ORDER BY RAND() and then retrieves the full records using an INNER JOIN

@collectiveaccess
Copy link
Owner

What version of MySQL are you running?

@behnaz-zarriz
Copy link
Author

What version of MySQL are you running?

Version 8.0.36

@collectiveaccess
Copy link
Owner

Performance for ORDER BY RAND() falls off a cliff for large data sets, which is why this current query is so wacky. We'll need to find another way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants