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

Reduce the size of data for analyze tests. #6674

Merged
merged 1 commit into from
Jan 7, 2024
Merged

Reduce the size of data for analyze tests. #6674

merged 1 commit into from
Jan 7, 2024

Conversation

vpetrovykh
Copy link
Member

Instead of generating a large dataset to force usage of indexes, disable sequential scan and use a smaller data set.

Fixes #6316

@vpetrovykh vpetrovykh requested a review from msullivan January 5, 2024 18:44
Copy link
Member

@msullivan msullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Maybe too much test churn to cherry-pick it cleanly, though we will see.

How quick is startup now?

Comment on lines +60 to +62
await con.query_single('select _set_seqscan("off")')
no_ex = '(execute := False) ' if not execute else ''
return json.loads(await (con or self.con).query_single(
return json.loads(await con.query_single(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make it configurable whether we turn of seqscan? Maybe some of tests could leave it on which would allow us to reduce test churn. Maybe not really, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For analyze tests leaving it on doesn't really help us, I think. If in the future we run into analyze tests that specifically need seqscan on then we can make it configurable.

Copy link
Member Author

@vpetrovykh vpetrovykh Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear regarding the test churn, part of this is also dramatically reducing the number of tests objects created. So the results of the original tests would likely not align even if you turned the seqscan on for them.

@vpetrovykh
Copy link
Member Author

vpetrovykh commented Jan 5, 2024

On my machine the startup for just the analyze tests went from ~55 seconds to ~25 seconds. For comparison bootstrapping the "edgeql_select" tests takes about 23 seconds. So I think this cut down the bootstrap time to about as low as it gets.

P.S. That's bootstrap without any caching, etc.

Instead of generating a large dataset to force usage of indexes, disable
sequential scan and use a smaller data set.

Fixes #6316
@vpetrovykh vpetrovykh merged commit c2d4211 into master Jan 7, 2024
21 checks passed
@vpetrovykh vpetrovykh deleted the analyze branch January 7, 2024 04:43
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.

Try using enable_seqscan=off to guide index analyze tests
2 participants