Re: pgsql: Add per-index stats information in verbose logs of autovacuum

2021-03-22 Thread Peter Geoghegan
On Mon, Mar 22, 2021 at 11:22 PM Michael Paquier wrote: > > To be clear, I agree that it would not be sensible to make the > > log_autovacuum_min_duration output 100% consistent with VACUUM > > VERBOSE. I just think that "%u remain" is misleading. It's just that > > one detail. > > Saying that, I

Re: pgsql: Add per-index stats information in verbose logs of autovacuum

2021-03-22 Thread Michael Paquier
On Mon, Mar 22, 2021 at 10:36:03PM -0700, Peter Geoghegan wrote: > It suggests that the index file can shrink. As if the remaining pages > are left now that the pages we deleted have been returned to the OS. I > think that this same line of output should look like this instead: > > index "

Re: pgsql: Add per-index stats information in verbose logs of autovacuum

2021-03-22 Thread Peter Geoghegan
On Mon, Mar 22, 2021 at 9:28 PM Michael Paquier wrote: > Add per-index stats information in verbose logs of autovacuum I think that this is very helpful -- thanks for working on it. However, it seems to me that "%u remain" is misleading. I am referring to this line of output: index "dups

pgsql: Add per-index stats information in verbose logs of autovacuum

2021-03-22 Thread Michael Paquier
Add per-index stats information in verbose logs of autovacuum Once a relation's autovacuum is completed, the logs include more information about this relation state if the threshold of log_autovacuum_min_duration (or its relation option) is reached, with for example contents about the statistics o

RE: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode

2021-03-22 Thread tsunakawa.ta...@fujitsu.com
From: Amit Kapila > Okay, I can revert this work to avoid that risk but it would be great > if you can share your thoughts on what alternative design do you have > in mind, and or how it should be better implemented? Regarding > performance overhead, it is for partitioned tables with a large numbe

pgsql: Fix dangling pointer reference in stream_cleanup_files.

2021-03-22 Thread Amit Kapila
Fix dangling pointer reference in stream_cleanup_files. We can't access the entry after it is removed from dynahash. Author: Peter Smith Discussion: https://postgr.es/m/CAHut+Ps-pL++f6CJwPx2+vUqXuew=xt-9bi-6kcyxn+fwi2...@mail.gmail.com Branch -- master Details --- https://git.postgresq

pgsql: Use correct spelling of statistics kind

2021-03-22 Thread Tomas Vondra
Use correct spelling of statistics kind A couple error messages and comments used 'statistic kind', not the correct 'statistics kind'. Fix and backpatch all the way back to 10, where extended statistics were introduced. Backpatch-through: 10 Branch -- master Details --- https://git.post

pgsql: Use correct spelling of statistics kind

2021-03-22 Thread Tomas Vondra
Use correct spelling of statistics kind A couple error messages and comments used 'statistic kind', not the correct 'statistics kind'. Fix and backpatch all the way back to 10, where extended statistics were introduced. Backpatch-through: 10 Branch -- REL_13_STABLE Details --- https://g

pgsql: Use correct spelling of statistics kind

2021-03-22 Thread Tomas Vondra
Use correct spelling of statistics kind A couple error messages and comments used 'statistic kind', not the correct 'statistics kind'. Fix and backpatch all the way back to 10, where extended statistics were introduced. Backpatch-through: 10 Branch -- REL_12_STABLE Details --- https://g

pgsql: Use correct spelling of statistics kind

2021-03-22 Thread Tomas Vondra
Use correct spelling of statistics kind A couple error messages and comments used 'statistic kind', not the correct 'statistics kind'. Fix and backpatch all the way back to 10, where extended statistics were introduced. Backpatch-through: 10 Branch -- REL_11_STABLE Details --- https://g

pgsql: Use correct spelling of statistics kind

2021-03-22 Thread Tomas Vondra
Use correct spelling of statistics kind A couple error messages and comments used 'statistic kind', not the correct 'statistics kind'. Fix and backpack all the way back to 10, where extended statistics were introduced. Backpatch-through: 10 Branch -- REL_10_STABLE Details --- https://gi

Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode

2021-03-22 Thread Amit Kapila
On Mon, Mar 22, 2021 at 8:03 PM Tom Lane wrote: > > Robert Haas writes: > > I find this fairly ugly. If you can't make the cost of checking > > whether parallelism is safe low enough that you don't need a setting > > for this, then I think perhaps you shouldn't have the feature at all. > > In oth

pgsql: Change the type of WalReceiverWaitStart wait event from Client t

2021-03-22 Thread Fujii Masao
Change the type of WalReceiverWaitStart wait event from Client to IPC. Previously the type of this wait event was Client. But while this wait event is being reported, walreceiver process is waiting for the startup process to set initial data for streaming replication. It's not waiting for any acti

pgsql: pg_waldump: Fix bug in per-record statistics.

2021-03-22 Thread Fujii Masao
pg_waldump: Fix bug in per-record statistics. pg_waldump --stats=record identifies a record by a combination of the RmgrId and the four bits of the xl_info field of the record. But XACT records use the first bit of those four bits for an optional flag variable, and the following three bits for the

pgsql: pg_waldump: Fix bug in per-record statistics.

2021-03-22 Thread Fujii Masao
pg_waldump: Fix bug in per-record statistics. pg_waldump --stats=record identifies a record by a combination of the RmgrId and the four bits of the xl_info field of the record. But XACT records use the first bit of those four bits for an optional flag variable, and the following three bits for the

pgsql: pg_waldump: Fix bug in per-record statistics.

2021-03-22 Thread Fujii Masao
pg_waldump: Fix bug in per-record statistics. pg_waldump --stats=record identifies a record by a combination of the RmgrId and the four bits of the xl_info field of the record. But XACT records use the first bit of those four bits for an optional flag variable, and the following three bits for the

pgsql: pg_waldump: Fix bug in per-record statistics.

2021-03-22 Thread Fujii Masao
pg_waldump: Fix bug in per-record statistics. pg_waldump --stats=record identifies a record by a combination of the RmgrId and the four bits of the xl_info field of the record. But XACT records use the first bit of those four bits for an optional flag variable, and the following three bits for the

pgsql: pg_waldump: Fix bug in per-record statistics.

2021-03-22 Thread Fujii Masao
pg_waldump: Fix bug in per-record statistics. pg_waldump --stats=record identifies a record by a combination of the RmgrId and the four bits of the xl_info field of the record. But XACT records use the first bit of those four bits for an optional flag variable, and the following three bits for the

pgsql: pg_waldump: Fix bug in per-record statistics.

2021-03-22 Thread Fujii Masao
pg_waldump: Fix bug in per-record statistics. pg_waldump --stats=record identifies a record by a combination of the RmgrId and the four bits of the xl_info field of the record. But XACT records use the first bit of those four bits for an optional flag variable, and the following three bits for the

pgsql: Add macro RelationIsPermanent() to report relation permanence

2021-03-22 Thread Bruce Momjian
Add macro RelationIsPermanent() to report relation permanence Previously, to check relation permanence, the Relation's Form_pg_class structure member relpersistence was compared to the value RELPERSISTENCE_PERMANENT ("p"). This commit adds the macro RelationIsPermanent() and is used in appropirate

pgsql: Pass all scan keys to BRIN consistent function at once

2021-03-22 Thread Tomas Vondra
Pass all scan keys to BRIN consistent function at once This commit changes how we pass scan keys to BRIN consistent function. Instead of passing them one by one, we now pass all scan keys for a given attribute at once. That makes the consistent function a bit more complex, as it has to loop throug

pgsql: Move bsearch_arg to src/port

2021-03-22 Thread Tomas Vondra
Move bsearch_arg to src/port Until now the bsearch_arg function was used only in extended statistics code, so it was defined in that code. But we already have qsort_arg in src/port, so let's move it next to it. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bfa2ce

pgsql: Optimize allocations in bringetbitmap

2021-03-22 Thread Tomas Vondra
Optimize allocations in bringetbitmap The bringetbitmap function allocates memory for various purposes, which may be quite expensive, depending on the number of scan keys. Instead of allocating them separately, allocate one bit chunk of memory an carve it into smaller pieces as needed - all the pi

pgsql: Move IS [NOT] NULL handling from BRIN support functions

2021-03-22 Thread Tomas Vondra
Move IS [NOT] NULL handling from BRIN support functions The handling of IS [NOT] NULL clauses is independent of an opclass, and most of the code was exactly the same in both minmax and inclusion. So instead move the code from support procedures to the AM. This simplifies the code - especially the

pgsql: Mostly-cosmetic adjustments of TOAST-related macros.

2021-03-22 Thread Tom Lane
Mostly-cosmetic adjustments of TOAST-related macros. The authors of bbe0a81db hadn't quite got the idea that macros named like SOMETHING_4B_C were only meant for internal endianness-related details in postgres.h. Choose more legible names for macros that are intended to be used elsewhere. Rearra

pgsql: Short-circuit slice requests that are for more than the object's

2021-03-22 Thread Tom Lane
Short-circuit slice requests that are for more than the object's size. substring(), and perhaps other callers, isn't careful to pass a slice length that is no more than the datum's true size. Since toast_decompress_datum_slice's children will palloc the requested slice length, this can waste memo

pgsql: Remove useless configure probe for .

2021-03-22 Thread Tom Lane
Remove useless configure probe for . This seems to have been just copied-and-pasted from some other header checks. But our C code is entirely unprepared to support such a header name, so it's only wasting cycles to look for it. If we did need to support it, some #ifdefs would be required. (A qui

pgsql: Error on invalid TOAST compression in CREATE or ALTER TABLE.

2021-03-22 Thread Robert Haas
Error on invalid TOAST compression in CREATE or ALTER TABLE. The previous coding treated an invalid compression method name as equivalent to the default, which is certainly not right. Justin Pryzby Discussion: http://postgr.es/m/20210321235544.gd4...@telsasoft.com Branch -- master Details

pgsql: docs: Fix omissions related to configurable TOAST compression.

2021-03-22 Thread Robert Haas
docs: Fix omissions related to configurable TOAST compression. Previously, the default_toast_compression GUC was not documented, and neither was pg_dump's new --no-toast-compression option. Justin Pryzby and Robert Haas Discussion: http://postgr.es/m/20210321235544.gd4...@telsasoft.com Branch -

Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode

2021-03-22 Thread Tom Lane
Robert Haas writes: > I find this fairly ugly. If you can't make the cost of checking > whether parallelism is safe low enough that you don't need a setting > for this, then I think perhaps you shouldn't have the feature at all. > In other words, I propose that you revert both this and 05c8482f7f

pgsql: More code cleanup for configurable TOAST compression.

2021-03-22 Thread Robert Haas
More code cleanup for configurable TOAST compression. Remove unused macro. Fix confusion about whether a TOAST compression method is identified by an OID or a char. Justin Pryzby Discussion: http://postgr.es/m/20210321235544.gd4...@telsasoft.com Branch -- master Details --- https://git

Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode

2021-03-22 Thread Robert Haas
On Wed, Mar 17, 2021 at 10:14 PM Amit Kapila wrote: > Add a new GUC and a reloption to enable inserts in parallel-mode. > > Commit 05c8482f7f added the implementation of parallel SELECT for > "INSERT INTO ... SELECT ..." which may incur non-negligible overhead in > the additional parallel-safety c