estimated_count() implementation

From: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
To: pgsql-hackers(at)postgresql(dot)org
Subject: estimated_count() implementation
Date: 2006-10-21 20:44:19
Message-ID: 20061021204419.GA4254@alamut
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 that will be
returned from planner(query, isCursor, cursorOptions, params)
function.) Is this the way to go, or should I look 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 same way 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. Am I looking
at the right place? For instance, for my case, I won't need any
transition function call. How should I modify nodeAgg.c to skip
transfn calls for estimated_count()?

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

Regards.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Theo Schlossnagle 2006-10-21 20:52:05 Re: xlogdump fixups and WAL log question.
Previous Message Simon Riggs 2006-10-21 20:40:57 Re: xlogdump fixups and WAL log question.