Thread: Re: Adding NOTICE for differences between estimated and actual rows
It's quite common that poor query performance can be attributed to inaccurate row estimations by the planner. To make it easier to detect these discrepancies, rather than scrutinizing the estimates manually, it would be helpful to output a dedicated
NOTICE
message.
$ cat /tmp/pcc.pl#!/usr/bin/perl -nprint "\033[1m\033[35m$1\033[36m$2\033[32m$3\033[33m$4\033[m" while /([|+-]+)|([0-9]+)|([a-zA-Z_]+)|([^\w])/g;and then you can start psql as:$ PAGER="/c/mypager.pl" psql
It's quite common that poor query performance can be attributed to inaccurate row estimations by the planner. To make it easier to detect these discrepancies, rather than scrutinizing the estimates manually, it would be helpful to output a dedicated
NOTICE
message.
Yes, you are right. It probably doesn't make sense to implement such a notification on the server side. It makes more sense to handle this on the client side, where there are many different tools, including your suggestion, to highlight inaccurate estimates.
Thank you very much for the review!
--
Regards,
Ilia Evdokimov,
Tantor Labs LCC.