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

[5.3] Avoid redundant "where" clauses on multiple calls to forPageAfterId() #16693

Closed
wants to merge 2 commits into from
Closed

[5.3] Avoid redundant "where" clauses on multiple calls to forPageAfterId() #16693

wants to merge 2 commits into from

Conversation

vlakoff
Copy link
Contributor

@vlakoff vlakoff commented Dec 7, 2016

Alternative to #16498.

Also filtering without using Collections, I think it's clearer this way (and about 10x faster).
Note the current code may receive Collection::make(null), thankfully this was working still.

@taylorotwell
Copy link
Member

This seems super fragile.

@vlakoff
Copy link
Contributor Author

vlakoff commented Dec 7, 2016

Indeed, as I was about to post this:

What about if, for instance, a max id had been specified? like:

$query->where('id', '<', 100)->forPageAfterId(...);
$query->where('id', '<', 100)->chunkById(...);

Currently, this PR would drop it. This example case could easily be prevented, by making the filter more precise. Though I guess similar issues would emerge later.

@vlakoff vlakoff deleted the forPageAfterId branch February 1, 2017 06:50
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