> BTW, we should do some performance testing by having a mix of DML and > DDLs to see the performance impact of this patch. > > [1] - > https://www.postgresql.org/message-id/CAD21AoAenVqiMjpN-PvGHL1N9DWnHSq673bfgr6phmBUzx=k...@mail.gmail.com >
I did some performance testing and I found some performance impact for the following case: 1. Created a publisher, subscriber set up on a single table, say 'tab_conc1'; 2. Created a second publisher, subscriber set on a single table say 'tp'; 3. Created 'tcount' no. of tables. These tables are not part of any publication. 4. There are two sessions running in parallel, let's say S1 and S2. 5. Begin a transaction in S1. 6. Now in a loop (this loop runs 100 times): S1: Insert a row in table 'tab_conc1' S1: Insert a row in all 'tcount' tables. S2: BEGIN; Alter publication for 2nd publication; COMMIT; The current logic in the patch will call the function 'rel_sync_cache_publication_cb' during invalidation. This will invalidate the cache for all the tables. So cache related to all the tables i.e. table 'tab_conc1', 'tcount' tables will be invalidated. 7. COMMIT the transaction in S1. The performance in this case is: No. of tables | With patch (in ms) | With head (in ms) ----------------------------------------------------------------------------- tcount = 100 | 101376.4 | 101357.8 tcount = 1000 | 994085.4 | 993471.4 For 100 tables the performance is slow by '0.018%' and for 1000 tables performance is slow by '0.06%'. These results are the average of 5 runs. Other than this I tested the following cases but did not find any performance impact: 1. with 'tcount = 10'. But I didn't find any performance impact. 2. with 'tcount = 0' and running the loop 1000 times. But I didn't find any performance impact. I have also attached the test script and the machine configurations on which performance testing was done. Next I am planning to test solely on the logical decoding side and will share the results. Thanks and Regards, Shlok Kyal
NAME="Red Hat Enterprise Linux Server" VERSION="7.9 (Maipo)" ID="rhel" ID_LIKE="fedora" VARIANT="Server" VARIANT_ID="server" VERSION_ID="7.9" PRETTY_NAME="Red Hat Enterprise Linux Server 7.9 (Maipo)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server" HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" REDHAT_BUGZILLA_PRODUCT_VERSION=7.9 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="7.9"
CPU INFO processor : 119 vendor_id : GenuineIntel cpu family : 6 model : 62 model name : Intel(R) Xeon(R) CPU E7-4890 v2 @ 2.80GHz stepping : 7 microcode : 0x715 cpu MHz : 1505.957 cache size : 38400 KB physical id : 3 siblings : 30 core id : 14 cpu cores : 15 apicid : 125 initial apicid : 125 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm epb intel_ppin ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d bogomips : 5629.54 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management:
MemTotal: 792237404 kB MemFree: 724051992 kB MemAvailable: 762505368 kB Buffers: 2108 kB Cached: 43885588 kB SwapCached: 0 kB Active: 22276460 kB Inactive: 21761812 kB Active(anon): 1199380 kB Inactive(anon): 4228212 kB Active(file): 21077080 kB Inactive(file): 17533600 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 4194300 kB SwapFree: 4194300 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 150796 kB Mapped: 5283248 kB Shmem: 5277044 kB Slab: 1472084 kB SReclaimable: 1165144 kB SUnreclaim: 306940 kB KernelStack: 17504 kB PageTables: 21540 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 400313000 kB Committed_AS: 86287072 kB VmallocTotal: 34359738367 kB VmallocUsed: 1942092 kB VmallocChunk: 33753397244 kB Percpu: 36352 kB HardwareCorrupted: 0 kB AnonHugePages: 81920 kB CmaTotal: 0 kB CmaFree: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 785756 kB DirectMap2M: 7432192 kB DirectMap1G: 799014912 kB
test.pl
Description: Binary data