Re: Hardware/OS recommendations for large databases (
| От | Greg Stark |
|---|---|
| Тема | Re: Hardware/OS recommendations for large databases ( |
| Дата | |
| Msg-id | 87d5kqkpd2.fsf@stark.xeocode.com обсуждение исходный текст |
| Ответ на | Re: Hardware/OS recommendations for large databases ( (Mark Kirkwood <markir@paradise.net.nz>) |
| Ответы |
Re: Hardware/OS recommendations for large databases (
|
| Список | pgsql-performance |
Mark Kirkwood <markir@paradise.net.nz> writes: > Yeah - it's pretty clear that the count aggregate is fairly expensive wrt cpu - > However, I am not sure if all agg nodes suffer this way (guess we could try a > trivial aggregate that does nothing for all tuples bar the last and just > reports the final value it sees). As you mention count(*) and count(1) are the same thing. Last I heard the reason count(*) was so expensive was because its state variable was a bigint. That means it doesn't fit in a Datum and has to be alloced and stored as a pointer. And because of the Aggregate API that means it has to be allocated and freed for every tuple processed. There was some talk of having a special case API for count(*) and maybe sum(...) to avoid having to do this. There was also some talk of making Datum 8 bytes wide on platforms where that was natural (I guess AMD64, Sparc64, Alpha, Itanic). Afaik none of these items have happened but I don't know for sure. -- greg
В списке pgsql-performance по дате отправления: