Matthew Wakeling <matthew@xxxxxxxxxxx> writes: > The final cumulative time is 5894.06 seconds, which doesn't seem to match > the query run time at all. Depending on the platform you're using, gprof might have the wrong idea about the kernel's tick rate, leading to its numbers being some multiple or fraction of the true elapsed time. I had that problem awhile back https://bugzilla.redhat.com/show_bug.cgi?id=151763 although I'd like to think it's fixed on all recent Linuxen. However, your bigger problem is here: > Also, no calls to anything including "bioseg" > in the name are recorded, although they are definitely called as the GiST > support functions for that data type. I have never had any success in getting gprof to profile functions that are in loadable libraries, which of course is exactly what you need to do here. I have found hints on the web claiming that it's possible, but they don't work for me. gprof just ignores both the functions and the time spent in them. Personally I generally use oprofile these days, because it doesn't have that problem and also doesn't require any special build options. If you don't have that available to you, the best bet is probably to make a test build of Postgres in which your functions are linked directly into the main postgres executable. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance