On Mon, Jun 19, 2017 at 3:47 PM, Peter Geoghegan <p...@bowt.ie> wrote: > On Mon, Jun 19, 2017 at 12:19 PM, Robert Haas <robertmh...@gmail.com> wrote: >> I don't have a specific use case in mind. However, datumCopy() is >> sure to be a lot faster when typByVal is true, and see also the >> documentation changes in commit >> 8472bf7a73487b0535c95e299773b882f7523463. > > Fair enough. > > I ask because at one time I informally benchmarked Postgres (using > pgbench), where int4 (or maybe int8) primary keys were replaced with > equivalent numeric primary keys. This was a SELECT benchmark. Anyway, > the conclusion at the time was that it makes surprisingly little > difference (I think it was ~5%), because cache misses dominate anyway, > and the page layout doesn't really change (the fan-in didn't change > *at all* either, at least for this one case, because of alignment > considerations). I never published this result, because I didn't have > time to test rigorously, and wasn't sure that there was sufficient > interest.
People work pretty hard for a 5% performance improvement, so I wouldn't dismiss that difference as nothing. However, I think the difference would probably be larger if you were using the values for computations (e.g. sum, avg) rather than as PKs. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers