{"Entry":{"collection":"guc","key":"enable_indexscan","name":"enable_indexscan","aliases":[],"metadata":{"baseline":true,"boot_human":"Not specified","boot_val":null,"category":"Query Tuning / Planner Method Configuration","category_zh":"","changed_in":[],"changes":[{"documentation_changed":true,"fields":{},"from":"7.4","status":"changed","to":"8.0"},{"documentation_changed":true,"fields":{},"from":"11","status":"changed","to":"12"}],"content_hash":"d494929e9de6b61bd59b47bef8f299d20432b63f18679889e8c2ff96591b9fce","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"on"}],"editorial":{"advice":{"olap":"Benchmark representative analytical plans with and without enable_indexscan. Judge planning time, memory, spill, and execution time together; a win for one report is not evidence for a global setting.","oltp":"Keep the upstream default for routine OLTP. Use a transaction- or session-local change to diagnose whether choosing ordinary index scans; this switch also gates consideration of index-only scans explains a regression, then repair statistics, indexes, estimates, or query shape instead of leaving a cluster-wide method ban.","small":"Do not use enable_indexscan as a permanent hint on a small host. Resource pressure may change the best method, so verify with EXPLAIN (ANALYZE, BUFFERS) and keep the change scoped to the affected workload if it is still needed."},"mechanism":["enable_indexscan controls whether the planner may choose ordinary index scans; this switch also gates consideration of index-only scans.","It is consulted while a plan is built. A session-level change is useful for comparing EXPLAIN alternatives, but an already cached plan is not retroactively rewritten; invalidation or replanning is required to observe a different choice.","The switch changes which candidate paths the planner may cost; it does not make the chosen method faster by itself. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value."],"pitfalls":["Treating enable_indexscan as a query hint even though it affects every plan built in its scope.","Testing an already cached prepared plan and concluding that the setting has no effect.","Masking stale statistics or cardinality errors by disabling a plan method globally.","The switch changes which candidate paths the planner may cost; it does not make the chosen method faster by itself."],"references":[{"title":"PostgreSQL 19 Beta 4: enable_indexscan","url":"https://www.postgresql.org/docs/19/runtime-config-query.html#GUC-ENABLE-INDEXSCAN"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["enable_indexonlyscan","enable_bitmapscan","enable_seqscan","random_page_cost","effective_cache_size"],"summary":"enable_indexscan — Enables the planner's use of index-scan plans. Observed in PG9.0–19 Beta 4; its last measured boot default is on in PG19 Beta 4, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"7.4","group":"Query Tuning","group_slug":"query","imported_at":"2026-09-27T17:57:31.200333+08:00","intro_commit":{},"key":"enable_indexscan","last_version":"20","max_val":"","min_val":"","name":"enable_indexscan","position":123,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"Enables or disables the query planner's use of index-scan and index-only-scan plan types.","short_desc_zh":"","source_rev":"english-manuals:47dc601a2b4247995b271d25f53ec1204628f18d75f98426a6127ca1c6271fc7","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"enable_indexscan","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"enable_indexscan","SourceRevision":"english-manuals:47dc601a2b4247995b271d25f53ec1204628f18d75f98426a6127ca1c6271fc7","Facts":{"boot_val":"on","category":"Query Tuning / Planner Method Configuration","context":"user","description":"Enables or disables the query planner's use of index-scan and index-only-scan plan types. The default is on. Also see enable_indexonlyscan.","doc":{"anchor":"GUC-ENABLE-INDEXSCAN","file":"runtime-config-query.html","lang":"en","sha256":"33456ca7ef52bf28e93e34b932a411db7a1b95800179add2cf867dc6ec9144bc","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"enable_indexscan","short_desc":"Enables the planner's use of index-scan plans.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-ENABLE-INDEXSCAN","file":"runtime-config-query.html","lang":"en","sha256":"33456ca7ef52bf28e93e34b932a411db7a1b95800179add2cf867dc6ec9144bc","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"enable_indexscan","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"enable_indexscan","Summary":"","BodyHTML":"\u003cp\u003e启用或禁用查询规划器对索引扫描和仅索引扫描计划类型的使用。默认值为 \u003ccode\u003eon\u003c/code\u003e。另请参见\u003ca href=\"/docs/18/runtime-config-query.html#GUC-ENABLE-INDEXONLYSCAN\" rel=\"nofollow\"\u003eenable_indexonlyscan\u003c/a\u003e。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"4a6ac9e99e8e84a7a55dfec466685a3f82812bde2456f3baf2bab4086825b8bb","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e启用或禁用查询规划器对索引扫描和仅索引扫描计划类型的使用。默认值为 \u003ccode class=\"literal\"\u003eon\u003c/code\u003e。另请参见\u003ca href=\"/docs/18/runtime-config-query.html#GUC-ENABLE-INDEXONLYSCAN\"\u003eenable_indexonlyscan\u003c/a\u003e。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
