1<!-- 2doc/src/sgml/ref/drop_statistics.sgml 3PostgreSQL documentation 4--> 5 6<refentry id="SQL-DROPSTATISTICS"> 7 <indexterm zone="sql-dropstatistics"> 8 <primary>DROP STATISTICS</primary> 9 </indexterm> 10 11 <refmeta> 12 <refentrytitle>DROP STATISTICS</refentrytitle> 13 <manvolnum>7</manvolnum> 14 <refmiscinfo>SQL - Language Statements</refmiscinfo> 15 </refmeta> 16 17 <refnamediv> 18 <refname>DROP STATISTICS</refname> 19 <refpurpose>remove extended statistics</refpurpose> 20 </refnamediv> 21 22 <refsynopsisdiv> 23<synopsis> 24DROP STATISTICS [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ] 25</synopsis> 26 </refsynopsisdiv> 27 28 <refsect1> 29 <title>Description</title> 30 31 <para> 32 <command>DROP STATISTICS</command> removes statistics object(s) from the 33 database. Only the statistics object's owner, the schema owner, or a 34 superuser can drop a statistics object. 35 </para> 36 37 </refsect1> 38 39 <refsect1> 40 <title>Parameters</title> 41 42 <variablelist> 43 <varlistentry> 44 <term><literal>IF EXISTS</literal></term> 45 <listitem> 46 <para> 47 Do not throw an error if the statistics object does not exist. A notice 48 is issued in this case. 49 </para> 50 </listitem> 51 </varlistentry> 52 53 <varlistentry> 54 <term><replaceable class="PARAMETER">name</replaceable></term> 55 <listitem> 56 <para> 57 The name (optionally schema-qualified) of the statistics object to drop. 58 </para> 59 </listitem> 60 </varlistentry> 61 62 <varlistentry> 63 <term><literal>CASCADE</literal></term> 64 <term><literal>RESTRICT</literal></term> 65 66 <listitem> 67 <para> 68 These key words do not have any effect, since there are no dependencies 69 on statistics. 70 </para> 71 </listitem> 72 </varlistentry> 73 74 </variablelist> 75 </refsect1> 76 77 <refsect1> 78 <title>Examples</title> 79 80 <para> 81 To destroy two statistics objects in different schemas, without failing 82 if they don't exist: 83 84<programlisting> 85DROP STATISTICS IF EXISTS 86 accounting.users_uid_creation, 87 public.grants_user_role; 88</programlisting></para> 89 </refsect1> 90 91 <refsect1> 92 <title>Compatibility</title> 93 94 <para> 95 There is no <command>DROP STATISTICS</command> command in the SQL standard. 96 </para> 97 </refsect1> 98 99 <refsect1> 100 <title>See Also</title> 101 102 <simplelist type="inline"> 103 <member><xref linkend="sql-alterstatistics"></member> 104 <member><xref linkend="sql-createstatistics"></member> 105 </simplelist> 106 </refsect1> 107 108</refentry> 109