estimated_count() implementation - Mailing list pgsql-hackers

From Volkan YAZICI
Subject estimated_count() implementation
Date
Msg-id 20061021204419.GA4254@alamut
Whole thread Raw
Responses Re: estimated_count() implementation
List pgsql-hackers
Hi,

I'm trying to implement estimated_count() function that's mentioned in
the TODO list. First of all, I wanted to learn if this TODO item is
still valid? I looked at the related -hackers discussions, does anybody
want to say more sth related with the implementation?

Also I've some questions. I'd be appreciated if somebody would answer
any of the below questions to help me find my way.

1. I'm planning to use same method as ExplainOneQuery() does in  backend/commands/explain.c. (Using Plan->plan_rows
thatwill be  returned from planner(query, isCursor, cursorOptions, params)  function.) Is this the way to go, or should
Ilook for another  method to aggregate estimated row count.
 

2. I've been also considering getting called from a nodeAgg. In such a  case, it shouldn't be a problem for me to use
sameway as above to  retrieve Query, ParamListInfo and TupOutputState. Right?
 

3. I was looking at int8inc() and backend/executor/nodeAgg.c and  couldn't find anything special to count() aggregate.
AmI looking  at the right place? For instance, for my case, I won't need any  transition function call. How should I
modifynodeAgg.c to skip  transfn calls for estimated_count()?
 

4. Related with the problem, any question I missed.


Regards.


pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: xlogdump fixups and WAL log question.
Next
From: Theo Schlossnagle
Date:
Subject: Re: xlogdump fixups and WAL log question.