Skip site navigation (1) Skip section navigation (2)

Cross-table statistics idea

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Cross-table statistics idea
Date: 2006-09-27 02:27:28
Message-ID: 20060927022728.GZ19827@nasby.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Since I don't recall any ideas ever having been thrown out on how to do
this...

ISTM that we could gain additional insight on how many rows would likely
result from a join be comparing the "shape" of the histogram for the
joining columns. For example, if the histogram arrays were exactly
identical, we're essentially stuck looking at the ratio of reltuples
between the two tables. (AFAIK that's the only estimate we make today)
If one histogram ended at a value smaller than the start of the other
histogram, we would estimate that no rows would result from an equal
join.

Am I right about how our estimates work right now? Where can I look in
the code? Has anyone looked down this path in the past?
-- 
Jim Nasby                                            jim(at)nasby(dot)net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2006-09-27 02:42:46
Subject: Re: Cross-table statistics idea
Previous:From: Tom LaneDate: 2006-09-27 02:25:48
Subject: Re: Faster StrNCpy

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group