Statistic Estimation in PostgreSQL - Mailing list pgsql-hackers

From rahulg
Subject Statistic Estimation in PostgreSQL
Date
Msg-id bf8efe22-eb2d-47e3-b92f-7ad4747198cb@n33g2000pri.googlegroups.com
Whole thread Raw
Responses Re: Statistic Estimation in PostgreSQL
Re: Statistic Estimation in PostgreSQL
List pgsql-hackers
I am facing problem in tracing in what events the selectivity
histogram in pg_statistic is stored/updated.

I went through the code in src/backend/commands/analyze.c and got to
see the code computing the histogram but when I tried to trace the
caller of analyze_rel or compute_index_stats, I find out that only
during Vaccum command, these functions are invoked. I am little
surprised as I did get to see PostgreSQL giving good selectivity
estimations despite me running Vaccuum command even once.

I did try to trace the control flow during table operations
(creation / insertion) but couldn't find any histogram updation
functions being invoked though I did get to know that some functions
related to catalog updations is being invoked.

Can anybody tell me in what all events is the pg_statistic table
exactly updated?


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: SlruPhysicalReadPage
Next
From: Tom Lane
Date:
Subject: Re: SlruPhysicalReadPage