pgstats_initstats() cost

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pgstats_initstats() cost
Date: 2003-08-12 01:05:34
Message-ID: Pine.LNX.4.21.0308121052520.25197-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I did some basic profiling of CVS HEAD after having read Bruce's post the
other day: When did we get so fast. It seemed to me that the number of
inserts per second wasn't actually all that high so I had a look at some
numbers:

% cumulative self self total
time seconds seconds calls s/call s/call name
7.32 3.48 3.48 100004 0.00 0.00 yyparse
4.42 5.58 2.10 1200107 0.00 0.00 SearchCatCache
4.10 7.53 1.95 900020 0.00 0.00 base_yylex
3.85 9.35 1.83 100150 0.00 0.00 XLogInsert
3.51 11.02 1.67 600540 0.00 0.00 pgstat_initstats
2.24 12.09 1.07 2208418 0.00 0.00 hash_search
1.86 12.97 0.88 2607669 0.00 0.00 hash_any

I am still researching ways of increasing performance of yacc parsers --
there is a very small amount of information on the Web concerning this --
but pgstat_initstats() caught my eye. This gets called about 6 times per
insert (I did 100000 inserts) and the major cost appears to relate to the
linear pgStatTabstatMessages. The comparative performance of
hash_search() suggests that pgStatTabstatMessages may benefit from use of
a hash. However, it seems unreasonable that we're doing work at all in
pgstat_initstats() if the user is not interested in query/block/tuple
stats.

Comments? Have I missed something?

Thanks,

Gavin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-08-12 01:09:52 Re: dropping a user causes pain (#2)
Previous Message Rod Taylor 2003-08-12 00:38:31 Re: Oversight?