RE: Delaying/avoiding BTreeTupleGetNAtts() call within _bt_compare()

From: Floris Van Nee <florisvannee(at)Optiver(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: RE: Delaying/avoiding BTreeTupleGetNAtts() call within _bt_compare()
Date: 2020-03-08 11:23:08
Message-ID: 829c8aebd8e948df8b0f8bf3e2c354c3@opammb0561.comp.optiver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Attached is v5, which inlines in a targeted fashion, pretty much in the same
> way as the earliest version. This is the same as v4 in every other way.
> Perhaps you can test this.
>

Thank you for the new patch. With the new one I am indeed able to reproduce a performance increase. It is very difficult to reliably reproduce it when running on a large number of cores though, due to the NUMA architecture.
For tests with a small number of cores, I pin all of them to the same node. With that, I see a significant performance increase for v5 compared to master. However, if I pin pgbench to a different node than the node that Postgres is pinned to, this leads to a 20% performance degradation compared to having all of them on the same node, as well as the stddev increasing by a factor of 2 (regardless of patch). With that, it becomes very difficult to see any kind of performance increase due to the patch. For a large number of pgbench workers, I cannot specifically pin the pgbench worker on the same node as the Postgres backend connection it's handling. Leaving it to the OS gives very unreliable results - when I run the 30 workers / 30 connections test, I sometimes see periods of up to 30 minutes where it's doing it 'correctly', but it could also randomly run at the -20% performance for a long time. So far my best bet at explaining this is the NUMA performance hit. I'd like to be able to specifically schedule some Postgres backends to run on one node, while other Postgres backends run on a different node, but this isn't straightforward.

For now, I see no issues with the patch though. However, in real life situations there may be other, more important, optimizations for people that use big multi-node machines.

Thoughts?

-Floris

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message James Coleman 2020-03-08 13:34:16 Re: Allow to_date() and to_timestamp() to accept localized names
Previous Message Juan José Santamaría Flecha 2020-03-08 11:16:56 Re: Allow to_date() and to_timestamp() to accept localized names