Re: How to specify/mock the statistic data of tables in PostgreSQL

From: "ygnhzeus" <ygnhzeus(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Amit Langote" <amitlangote09(at)gmail(dot)com>, "Atri Sharma" <atri(dot)jiit(at)gmail(dot)com>, "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to specify/mock the statistic data of tables in PostgreSQL
Date: 2014-01-13 15:34:01
Message-ID: 52D4075C.20605@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I see, thanks, so columns of staop* are not currently used by the planner by default, right?
The type of staop is oid, which table is related to it?

2014-01-13

ygnhzeus

发件人:Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
发送时间:2014-01-13 23:21
主题:Re: [GENERAL] How to specify/mock the statistic data of tables in PostgreSQL
收件人:"Felix.徐"<ygnhzeus(at)gmail(dot)com>
抄送:"Amit Langote"<amitlangote09(at)gmail(dot)com>,"Atri Sharma"<atri(dot)jiit(at)gmail(dot)com>,"pgsql-general"<pgsql-general(at)postgresql(dot)org>

=?GB2312?B?RmVsaXgu0Ow=?= <ygnhzeus(at)gmail(dot)com> writes:
> //line 194 : In a "most common values" slot, staop is the OID of the "="
> operator used to decide whether values are the same or not.
> //line 206 : A "histogram" slot describes the distribution of scalar data.
> staop is the OID of the "<" operator that describes the sort ordering.

> I don't understand the function of staop here, how is it used in optimizer,

In principle a data type could have more than one sort ordering, and if
we were to collect stats according to multiple orderings, staop would be
needed to identify which ordering a particular set of statistics was
created with. That flexibility isn't being used right now, at least not
by any built-in code. There are types with more than one ordering (more
than one btree opclass), but ANALYZE only collects stats for the default
btree opclass.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-01-13 15:35:31 Re: PG 924, Windows 2012, error code 487
Previous Message Tom Lane 2014-01-13 15:21:10 Re: How to specify/mock the statistic data of tables in PostgreSQL