Re: gprof SELECT COUNT(*) results

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: gprof SELECT COUNT(*) results
Дата
Msg-id 87veyhjtr0.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: gprof SELECT COUNT(*) results  (Qingqing Zhou <zhouqq@cs.toronto.edu>)
Ответы Re: gprof SELECT COUNT(*) results  (Qingqing Zhou <zhouqq@cs.toronto.edu>)
Список pgsql-hackers
Qingqing Zhou <zhouqq@cs.toronto.edu> writes:

> Yeah, understood. What I can't understand that in this case why it costs
> so much -- without concurrency, the LWLock code path just invloves
> spinlock_lock/unlock and serveral simple instructions?

You executed LWLock 2.6 million times in just under 300ms. If my math is right
that's about 115 nanoseconds per lock or about 300 cycles on a 2.6Ghz
processor.

That sounds like a lot but it's about the right order of magnitude. Was this
on a multiprocessor machine? In which case a big part of that time is probably
spent synchronizing between the processors.

-- 
greg



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: NULL safe equality operator
Следующее
От: Qingqing Zhou
Дата:
Сообщение: Re: gprof SELECT COUNT(*) results