diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/src/sgml/catalogs.sgml | 9 | ||||
| -rw-r--r-- | doc/src/sgml/ref/create_type.sgml | 31 |
2 files changed, 36 insertions, 4 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index c2d62822e5a..4baae556b31 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1,6 +1,6 @@ <!-- Documentation of the system catalogs, directed toward PostgreSQL developers - $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.82 2004/01/06 23:55:18 tgl Exp $ + $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.83 2004/02/12 23:41:00 tgl Exp $ --> <chapter id="catalogs"> @@ -3525,6 +3525,13 @@ </row> <row> + <entry><structfield>typanalyze</structfield></entry> + <entry><type>regproc</type></entry> + <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry> + <entry>Custom ANALYZE function, or 0 to use the standard function</entry> + </row> + + <row> <entry><structfield>typalign</structfield></entry> <entry><type>char</type></entry> <entry></entry> diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml index dfb7ab15109..ba63f4378bb 100644 --- a/doc/src/sgml/ref/create_type.sgml +++ b/doc/src/sgml/ref/create_type.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.48 2003/11/29 19:51:38 pgsql Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.49 2004/02/12 23:41:02 tgl Exp $ PostgreSQL documentation --> @@ -28,6 +28,7 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> ( OUTPUT = <replaceable class="parameter">output_function</replaceable> [ , RECEIVE = <replaceable class="parameter">receive_function</replaceable> ] [ , SEND = <replaceable class="parameter">send_function</replaceable> ] + [ , ANALYZE = <replaceable class="parameter">analyze_function</replaceable> ] [ , INTERNALLENGTH = { <replaceable class="parameter">internallength</replaceable> | VARIABLE } ] [ , PASSEDBYVALUE ] [ , ALIGNMENT = <replaceable class="parameter">alignment</replaceable> ] @@ -83,8 +84,9 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> ( <replaceable class="parameter">input_function</replaceable> and <replaceable class="parameter">output_function</replaceable> are required, while the functions - <replaceable class="parameter">receive_function</replaceable> and - <replaceable class="parameter">send_function</replaceable> + <replaceable class="parameter">receive_function</replaceable>, + <replaceable class="parameter">send_function</replaceable> and + <replaceable class="parameter">analyze_function</replaceable> are optional. Generally these functions have to be coded in C or another low-level language. </para> @@ -153,6 +155,19 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> ( </para> <para> + The optional <replaceable class="parameter">analyze_function</replaceable> + performs type-specific statistics collection for columns of the data type. + By default, <command>ANALYZE</> will attempt to gather statistics using + the type's <quote>equals</> and <quote>less-than</> operators, if there + is a default b-tree operator class for the type. For non-scalar types + this behavior is likely to be unsuitable, so it can be overridden by + specifying a custom analysis function. The analysis function must be + declared to take a single argument of type <type>internal</>, and return + a <type>boolean</> result. The detailed API for analysis functions appears + in <filename>src/include/commands/vacuum.h</>. + </para> + + <para> While the details of the new type's internal representation are only known to the I/O functions and other functions you create to work with the type, there are several properties of the internal representation @@ -342,6 +357,16 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> ( </varlistentry> <varlistentry> + <term><replaceable class="parameter">analyze_function</replaceable></term> + <listitem> + <para> + The name of a function that performs statistical analysis for the + data type. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><replaceable class="parameter">internallength</replaceable></term> <listitem> <para> |
