{"Entry":{"collection":"sql","key":"drop-statistics","name":"DROP STATISTICS","aliases":["dropstatistics"],"metadata":{"aliases":["dropstatistics"],"changed_in":[],"changes":[{"from":"9.6","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"added","synopsis":null,"to":"10"}],"content_hash":"6c40249207eed7105b11246b91b2681e3f0345ef40392947eb1b11bebc809063","derived_content_hash":"8ee7b0b5f4e7d822c0f210493f93ebfffb6586d9da65cd68b851adac4e042450","editorial":{},"first_version":"10","group":"index","imported_at":"2026-09-30T17:43:36.957639+08:00","last_version":"20","name":"DROP STATISTICS","object":"STATISTICS","position":1006,"present_in":["10","11","12","13","14","15","16","17","18","19","20"],"purpose":"remove extended statistics","purpose_zh":"","related":["alter-statistics","create-statistics"],"repair_provenance":{"original_source_revision":"a709ab85","receipt_sha256":"f072984ee305df6aa5f20f3dd8078e251f2245128e011f07672704d4cbf21fe0","repair":"wiki-repair-20261023"},"slug":"drop-statistics","source_rev":"wiki-repair-20261023:b066b0f1578189f0136373295b973de326461f2dd974a745c6894ac718c22801","synopsis":"DROP STATISTICS [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]","verb":"DROP"}},"Definition":{"Collection":"sql","Key":"drop-statistics","SourceDatabase":"center","Version":"18","SourceTable":"sqlcmd","SourceKey":"drop-statistics","SourceRevision":"wiki-repair-20261023:b066b0f1578189f0136373295b973de326461f2dd974a745c6894ac718c22801","Facts":{"anchor":"SQL-DROPSTATISTICS","description_zh":"删除扩展统计对象","description_zh_html":"\u003cpre\u003eDROP STATISTICS [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003ccode class=\"command\"\u003eDROP STATISTICS\u003c/code\u003e 从数据库中删除一个或多个统计对象。只有统计对象的拥有者、模式的拥有者或超级用户才能删除统计对象。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e参数\u003c/h2\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      如果统计对象不存在，则不要抛出错误。这种情况下会发出一个提示。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      要删除的统计对象名称（可选模式限定）。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      这些关键字没有任何作用，因为没有对象依赖于统计对象。\n     \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e示例\u003c/h2\u003e\u003cp\u003e\n   删除不同模式中的两个统计对象；如果它们不存在也不会失败：\n\n\u003c/p\u003e\u003cpre class=\"programlisting\"\u003e\nDROP STATISTICS IF EXISTS\n    accounting.users_uid_creation,\n    public.grants_user_role;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e兼容性\u003c/h2\u003e\u003cp\u003e\n   SQL 标准中没有 \u003ccode class=\"command\"\u003eDROP STATISTICS\u003c/code\u003e 命令。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e另见\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/zh/docs/18/sql-alterstatistics.html\" title=\"ALTER STATISTICS\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER STATISTICS\u003c/span\u003e\u003c/a\u003e, \u003ca class=\"xref\" href=\"/zh/docs/18/sql-createstatistics.html\" title=\"CREATE STATISTICS\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE STATISTICS\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","file":"sql-dropstatistics.html","lang":"en","name":"DROP STATISTICS","purpose":"remove extended statistics","purpose_zh":"删除扩展统计对象","related":["alter-statistics","create-statistics"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eDROP STATISTICS\u003c/code\u003e removes statistics object(s) from the database. Only the statistics object's owner, the schema owner, or a superuser can drop a statistics object.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eDo not throw an error if the statistics object does not exist. A notice is issued in this case.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name (optionally schema-qualified) of the statistics object to drop.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThese key words do not have any effect, since there are no dependencies on statistics.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eTo destroy two statistics objects in different schemas, without failing if they don't exist:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eDROP STATISTICS IF EXISTS\n    accounting.users_uid_creation,\n    public.grants_user_role;\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003eThere is no \u003ccode class=\"command\"\u003eDROP STATISTICS\u003c/code\u003e command in the SQL standard.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/alter-statistics/?v=18\" title=\"ALTER STATISTICS\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER STATISTICS\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-statistics/?v=18\" title=\"CREATE STATISTICS\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE STATISTICS\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","slug":"18","synopsis_html":"DROP STATISTICS [ IF EXISTS ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e [, ...] [ CASCADE | RESTRICT ]","synopsis_text":"DROP STATISTICS [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/sql-dropstatistics.html","sha256":"f91b28777573178c65f826e441d08ff1143f5fe701f4e0babd6cc9efab0dc582"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-pgdoc"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"drop-statistics","SourceDatabase":"center","Version":"18","Locale":"en","Title":"DROP STATISTICS","Summary":"remove extended statistics","BodyHTML":"\u003cpre\u003eDROP STATISTICS [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003eDescription\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eDROP STATISTICS\u003c/code\u003e removes statistics object(s) from the database. Only the statistics object\u0026#39;s owner, the schema owner, or a superuser can drop a statistics object.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eParameters\u003c/h2\u003e\u003cdiv\u003e\u003cdl\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eDo not throw an error if the statistics object does not exist. A notice is issued in this case.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name (optionally schema-qualified) of the statistics object to drop.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eCASCADE\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThese key words do not have any effect, since there are no dependencies on statistics.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eExamples\u003c/h2\u003e\u003cp\u003eTo destroy two statistics objects in different schemas, without failing if they don\u0026#39;t exist:\u003c/p\u003e\u003cpre\u003eDROP STATISTICS IF EXISTS\n    accounting.users_uid_creation,\n    public.grants_user_role;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eCompatibility\u003c/h2\u003e\u003cp\u003eThere is no \u003ccode\u003eDROP STATISTICS\u003c/code\u003e command in the SQL standard.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/wiki/sql/alter-statistics/?v=18\" title=\"ALTER STATISTICS\" rel=\"nofollow\"\u003e\u003cspan\u003eALTER STATISTICS\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-statistics/?v=18\" title=\"CREATE STATISTICS\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE STATISTICS\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","SourceRevision":"wiki-repair-20261023:b066b0f1578189f0136373295b973de326461f2dd974a745c6894ac718c22801","ContentHash":"7c865501ea850338ce846e3d357227bb950f90ca7d0d4259358cb808cf7a6a87","Payload":{"related":["alter-statistics","create-statistics"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eDROP STATISTICS\u003c/code\u003e removes statistics object(s) from the database. Only the statistics object's owner, the schema owner, or a superuser can drop a statistics object.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eDo not throw an error if the statistics object does not exist. A notice is issued in this case.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name (optionally schema-qualified) of the statistics object to drop.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThese key words do not have any effect, since there are no dependencies on statistics.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eTo destroy two statistics objects in different schemas, without failing if they don't exist:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eDROP STATISTICS IF EXISTS\n    accounting.users_uid_creation,\n    public.grants_user_role;\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003eThere is no \u003ccode class=\"command\"\u003eDROP STATISTICS\u003c/code\u003e command in the SQL standard.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/alter-statistics/?v=18\" title=\"ALTER STATISTICS\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER STATISTICS\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/create-statistics/?v=18\" title=\"CREATE STATISTICS\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE STATISTICS\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","synopsis_html":"DROP STATISTICS [ IF EXISTS ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e [, ...] [ CASCADE | RESTRICT ]","synopsis_text":"DROP STATISTICS [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]"}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
