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
Consider allowing unbuffered queries for ORM SelectQuery #17517
Comments
You could use |
@ADmad The problem is that we rely on the cake ORM for some facilities and we would need to re-implement them on PDO. We cannot use pagination because it creates gaps or missing records because of record creation/deletions while the report is running. |
Why can't you buffer the results from the first query? |
Memory usage is too much to run the first query with buffering enabled (before we even get to the ORM). We create huge xml files from thousands of records. All workers are limited to 128M which is not enough for our bigger customers. So we have to use an unbuffered ORM query to fetch record by record consistently and use a "normal" buffered query to "decorate" each record with associations and related data. |
So you worker is batching jobs by pulling N records from this first query then building the rest of the data just for that set and then releasing the data before the next batch? Is it not possible to just pull the records you need each batch? |
@othercorey Let me explain it better:
Hope this makes it clear. |
FYI - we are considering this, but don't have an immediate solution. |
Description
The main blocker we have to move to 5.x is the use of unbuffered queries. Our reports are created in the following way:
We could not find a replacement for 5.x. Note: We cannot simply use PDO for 1 because we rely on the ORM for access control and other facilities.
CakePHP Version
5.0
The text was updated successfully, but these errors were encountered: