pgsql: Extract the multiplier for CPU process cost of index page into a

2023-01-08 Thread Alexander Korotkov
Extract the multiplier for CPU process cost of index page into a macro B-tree, GiST and SP-GiST all charge 50.0 * cpu_operator_cost for processing an index page. Extract this to a macro to avoid repeated magic numbers. Discussion: https://mail.google.com/mail/u/0/?ik=a20b091faa&view=om&permmsgi

pgsql: Improve GIN cost estimation

2023-01-08 Thread Alexander Korotkov
Improve GIN cost estimation GIN index scans were not taking any descent CPU-based cost into account. That made them look cheaper than other types of indexes when they shouldn't be. We use the same heuristic as for btree indexes, but multiply it by the number of searched entries. Additionally, t

pgsql: Doc: improve commentary about providing our own definitions of M

2023-01-08 Thread Tom Lane
Doc: improve commentary about providing our own definitions of M_PI. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/5687e7810f1dd32ac1960e67b608c441d87bc229 Modified Files -- contrib/earthdistance/earthdistance.c | 1 + src/bin/pgbench/pgbench.c

pgsql: Perform apply of large transactions by parallel workers.

2023-01-08 Thread Amit Kapila
Perform apply of large transactions by parallel workers. Currently, for large transactions, the publisher sends the data in multiple streams (changes divided into chunks depending upon logical_decoding_work_mem), and then on the subscriber-side, the apply worker writes the changes into temporary f

pgsql: Allow left join removals and unique joins on partitioned tables

2023-01-08 Thread David Rowley
Allow left join removals and unique joins on partitioned tables This allows left join removals and unique joins to work with partitioned tables. The planner just lacked sufficient proofs that a given join would not cause any row duplication. Unique indexes currently serve as that proof, so have