{"record":{"id":"031d0d7bed4edadf","repo":"dbt-labs/dbt-core","slug":"dbt-is-currently-configured-to-list-a-maximum-of","errorCode":null,"errorMessage":"dbt is currently configured to list a maximum of {{ max_results_per_iter * max_iter }} objects per schema. {{ schema }} exceeds this limit. If this is expected, you may configure this limit by setting list_relations_per_page and list_relations_page_limit in your project flags. It is recommended to start by increasing list_relations_page_limit.","messagePattern":"dbt is currently configured to list a maximum of (.+?)\\} objects per schema\\. (.+?)\\} exceeds this limit\\. If this is expected, you may configure this limit by setting list_relations_per_page and list_relations_page_limit in your project flags\\. It is recommended to start by increasing list_relations_page_limit\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/dbt-loader/src/dbt_macro_assets/dbt-snowflake/macros/metadata/list_relations_without_caching.sql","lineNumber":31,"sourceCode":"        {{ schema }} exceeds this limit. If this is expected, you may configure this limit\n        by setting list_relations_per_page and list_relations_page_limit in your project flags.\n        It is recommended to start by increasing list_relations_page_limit.\n    {%- endset -%}\n\n    {%- set paginated_state = namespace(paginated_results=[], watermark=none) -%}\n\n    {#-\n        loop an extra time to catch the breach of max iterations\n        Note: while range is 0-based, loop.index starts at 1\n    -#}\n    {%- for _ in range(max_iter + 1) -%}\n\n        {#-\n            raise a warning and break if we still didn't exit and we're beyond the max iterations limit\n            Note: while range is 0-based, loop.index starts at 1\n        -#}\n        {%- if loop.index == max_iter + 1 -%}\n            {%- do exceptions.warn(too_many_relations_msg) -%}\n            {%- break -%}\n        {%- endif -%}\n\n        {%- set show_objects_sql = snowflake__show_objects_sql(schema, max_results_per_iter, paginated_state.watermark) -%}\n        {%- set paginated_result = run_query(show_objects_sql) -%}\n        {%- do paginated_state.paginated_results.append(paginated_result) -%}\n        {%- set paginated_state.watermark = paginated_result.columns.get('name').values()[-1] -%}\n\n        {#- we got less results than the max_results_per_iter (includes 0), meaning we reached the end -#}\n        {%- if (paginated_result | length) < max_results_per_iter -%}\n            {%- break -%}\n        {%- endif -%}\n\n    {%- endfor -%}\n\n    {#- grab the first table in the paginated results to access the `merge` method -#}\n    {%- set agate_table = paginated_state.paginated_results[0] -%}\n    {%- do return(agate_table.merge(paginated_state.paginated_results)) -%}","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-loader/src/dbt_macro_assets/dbt-snowflake/macros/metadata/list_relations_without_caching.sql#L13-L49","documentation":"This warning is emitted by the Snowflake `list_relations_without_caching` macro during schema listing. When paginated SHOW OBJECTS iteration exceeds the maximum number of pages (`max_iter`), dbt warns with the total object cap (`max_results_per_iter * max_iter`) and breaks out of the loop, so the cached relation list for the schema is incomplete. dbt configurable pagination via `list_relations_per_page` and `list_relations_page_limit` project flags.","triggerScenarios":"Running `dbt run`/`dbt docs` against a Snowflake schema containing more objects than `list_relations_per_page * list_relations_page_limit` (default cap), so SHOW OBJECTS pagination never terminates before the iteration limit.","commonSituations":"Very large shared/analytics schemas with thousands of tables/views; default page limits hit during cache population; runs against schemas polluted by other tools.","solutions":["Increase `list_relations_page_limit` in project flags (recommended first step) so more pages are iterated","Increase `list_relations_per_page` to fetch more objects per SHOW OBJECTS query","Move models out of the oversized schema, or clean up unused relations to get under the limit","Scope dbt to a dedicated schema for the project to reduce object count"],"exampleFix":"// before (dbt_project.yml)\nflags:\n  list_relations_per_page: 10000\n// after\nflags:\n  list_relations_per_page: 10000\n  list_relations_page_limit: 10","handlingStrategy":"validation","validationCode":"// before running dbt, estimate schema object count against the pagination cap\nconst cap = flags.list_relations_per_page * flags.list_relations_page_limit;\nconst objectCount = await countObjectsInSchema(schema);\nif (objectCount >= cap) {\n  console.warn(`Schema has ${objectCount} objects >= cap ${cap}; raise list_relations_page_limit.`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set explicit list_relations_per_page / list_relations_page_limit flags for very large schemas","Keep dbt models in a dedicated schema to bound object count","Periodically drop orphaned tables/views created outside dbt","After seeing this warning, run `dbt run --no-populate-cache` or accept an incomplete relation cache consciously"],"tags":["snowflake","dbt","pagination","cache","large-schema"],"backgroundTag":"value-out-of-range","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}