ohp@pyrenet.fr writes:
> I don't know much about DBI/DBD but I know sqlgrey uses a lot of
> prepare/prepare_cached statements.
Well, those aren't exactly free.
Possibly you could learn something about it by attaching to one of
these backends with gdb and executing
call MemoryContextStats(TopMemoryContext)
This will dump a memory map to stderr.
regards, tom lane