Teodor Sigaev <[EMAIL PROTECTED]> writes: >>> Tom, I want to notice that initGISTstate is called for every inserting >>> value (for each row). I think it's not good, because this function >>> called 'fmgr_info' 7 times. 'fmgr_info' call a >>> 'load_external_function' with execution of sequence search on library >>> name. Any suggestion? >> >> fmgr_info shouldn't be all that expensive; I'm not really inclined to >> worry about it. Do you have evidence to the contrary?
> Result: > 1. Original gist.c > % time psql wow < sql.cmd > psql wow < sql.cmd 0.00s user 0.02s system 0% cpu 7.170 total > 2. Patched gist.c > % time psql wow < sql.cmd > psql wow < sql.cmd 0.02s user 0.00s system 2% cpu 0.699 total > We can see that calling fmgr_info for 70000 times may be very expensive. Okay, I've done something about this: fmgr_info results for index support functions are now kept in the relcache. I now get roughly the same timings for loading 10000 tuples into either a plain btree index or a btree_gist index, rather than a factor-of-7 penalty for btree_gist as before ... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]