[HACKERS] auto_explain : log queries with wrong estimation - Mailing list pgsql-hackers

From Adrien Nayrat
Subject [HACKERS] auto_explain : log queries with wrong estimation
Date
Msg-id 55d18a40-d99f-eccc-7323-62e0806ad7a6@dalibo.com
Whole thread Raw
Responses Re: [HACKERS] auto_explain : log queries with wrong estimation  (Maksim Milyutin <milyutinma@gmail.com>)
List pgsql-hackers
Hi hackers,


I try to made a patch to auto_explain in order to log queries with wrong estimation.

I compare planned row id : queryDesc->planstate->plan->plan_rows

Vs ntuples : queryDesc->planstate->instrument->ntuples;

If I understand, instrumentation is used only with explain. So my patch works
only with explain (and segfault without).


Is there a simple way to get ntuples?

Attached a naive patch.

Thanks :)

--
Adrien NAYRAT

http://dalibo.com - http://dalibo.org

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: [HACKERS] MCXT_ALLOC_NO_OOM -> DSA_ALLOC_NO_OOM in dsa.c
Next
From: Thomas Munro
Date:
Subject: Re: [HACKERS] POC: Sharing record typmods between backends