{"record":{"id":"d6892a76d7d28d5a","repo":"phalcon/cphalcon","slug":"eager-loading-modelname-returned-rowcount-ro","errorCode":null,"errorMessage":"Eager loading '{modelName}' returned {rowCount} rows which exceeds the limit of {limit}","messagePattern":"Eager loading '(.+?)' returned (.+?) rows which exceeds the limit of (.+?)","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Exceptions\\EagerRowLimitExceeded","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Eager/Loader.zep","lineNumber":613,"sourceCode":"\n            let columnList = str_replace(\" \", \"\", columnList);\n\n            for referencedField in referencedFields {\n                if unlikely false === strpos(columnList, referencedField) {\n                    throw new MissingEagerKeyColumn(alias, referencedField);\n                }\n            }\n        }\n\n        let resultset = call_user_func_array(\n            [modelInstance, \"find\"],\n            [findParams]\n        );\n\n        resultset->materialize();\n\n        if unlikely resultset->count() > self::MAX_ROWS_PER_LEVEL {\n            throw new EagerRowLimitExceeded(\n                referencedModel,\n                resultset->count(),\n                self::MAX_ROWS_PER_LEVEL\n            );\n        }\n\n        return resultset;\n    }\n\n    /**\n     * Relation fields are declared as a string for a single column and an\n     * array for a composite key. Normalizing removes that fork everywhere\n     * downstream.\n     */\n    protected function normalizeFields(var fields) -> array\n    {\n        if typeof fields === \"array\" {\n            return fields;","sourceCodeStart":595,"sourceCodeEnd":631,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Eager/Loader.zep#L595-L631","documentation":"Thrown after an eager-loading batch query is materialized: the number of rows fetched at this level exceeds Loader::MAX_ROWS_PER_LEVEL, a hard safety cap preventing unbounded memory use when an eager path fans out over too many parents.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Eager/Loader.zep:613 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Narrow the parent query (where/limit) so fewer rows are eager-loaded at once","Load the relation lazily instead of eagerly if the result set is legitimately large","Split the eager load into smaller batches of parents"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","contentChangedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}