Marek Florianczyk <franki(at)tpi(dot)pl> writes:
> But did you do that under some database load ? eg. 100 clients
> connected, like in my example ? When I do these queries "\d" without any
> clients connected and after ANALYZE it's fast, but only 100 clients is
> enough to lengthen query time to 30 sec. :(
Then it's not \d's fault --- you simply don't have enough horsepower to
support 100 concurrent clients, regardless of what specific query you're
testing.
You might find that not reconnecting so often would improve matters;
I'm sure that a lot of your cycles are being taken by backend startup.
regards, tom lane