Re: Minor code improvements to create_foreignscan_plan/ExecInitForeignScan

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Minor code improvements to create_foreignscan_plan/ExecInitForeignScan
Date: 2015-09-01 06:20:16
Message-ID: 55E543A0.8060804@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015/08/30 13:06, David Rowley wrote:
> It's likely not worth changing if there's cases when it'll be slower,
> but curiosity got the better of me and I wondered how extreme a case it
> would take to actually see a slowdown, and per my benchmark results the
> first used column would have to be about attnum 500.

> I used the attached to benchmark. has_system_columns is the current
> method, has_system_columns2 has my changes. Lines are prefixed by the
> position where the first (and only) attnum appears in the bitmap set.

> 1 has_system_columns complete in 1.196000
> 1 has_system_columns2 complete in 0.170000
> 2 has_system_columns complete in 1.198000
> 2 has_system_columns2 complete in 0.167000
> 4 has_system_columns complete in 1.197000
> 4 has_system_columns2 complete in 0.170000
> 8 has_system_columns complete in 1.206000
> 8 has_system_columns2 complete in 0.203000
> 16 has_system_columns complete in 1.202000
> 16 has_system_columns2 complete in 0.237000
> 32 has_system_columns complete in 1.206000
> 32 has_system_columns2 complete in 0.232000
> 64 has_system_columns complete in 1.207000
> 64 has_system_columns2 complete in 0.268000
> 128 has_system_columns complete in 1.205000
> 128 has_system_columns2 complete in 0.368000
> 256 has_system_columns complete in 1.203000
> 256 has_system_columns2 complete in 0.780000
> 512 has_system_columns complete in 1.202000
> 512 has_system_columns2 complete in 1.302000
> 1024 has_system_columns complete in 1.199000
> 1024 has_system_columns2 complete in 3.539000

> So, for what it's worth, could be 6 times faster for an "average" sized
> table, but hey, we're talking nanoseconds anyway...

That's interesting. But ISTM that that needs more discussion, so I'd
like to leave the method as-is at least for now.

Thanks for the experiment!

Best regards,
Etsuro Fujita

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2015-09-01 06:51:43 Re: checkpointer continuous flushing
Previous Message Michael Paquier 2015-09-01 06:08:20 Re: Fwd: Core dump with nested CREATE TEMP TABLE