Re: [Proposal] Global temporary tables

2020-07-22 Thread Pavel Stehule
> I am thinking about explicit LOCK statements. Some applications use > explicit locking from some reasons - typically as protection against race > conditions. > > But on GTT race conditions are not possible. So my question is - does the > exclusive lock on GTT protection other sessions do insert

Re: [POC] Fast COPY FROM command for the table with foreign partitions

2020-07-22 Thread Andrey V. Lepikhov
On 7/16/20 2:14 PM, Amit Langote wrote: Amit Langote EnterpriseDB: http://www.enterprisedb.com Version 5 of the patch. With changes caused by Amit's comments. -- regards, Andrey Lepikhov Postgres Professional >From 24465d61d6f0ec6a45578d252bda1690ac045543 Mon Sep 17 00:00:00 2001 From: Andrey

Re: Resetting spilled txn statistics in pg_stat_replication

2020-07-22 Thread Masahiko Sawada
On Thu, 16 Jul 2020 at 20:01, Amit Kapila wrote: > > On Thu, Jul 16, 2020 at 4:04 PM Masahiko Sawada > wrote: > > > > On Thu, 16 Jul 2020 at 18:16, Amit Kapila wrote: > > > > > > On Thu, Jul 16, 2020 at 1:45 PM Masahiko Sawada > > > wrote: > > > > > > > > A possible solution would be to add an

Re: Global snapshots

2020-07-22 Thread Masahiko Sawada
On Mon, 13 Jul 2020 at 20:18, Amit Kapila wrote: > > On Fri, Jul 10, 2020 at 8:46 AM Masahiko Sawada > wrote: > > > > On Wed, 8 Jul 2020 at 21:35, Amit Kapila wrote: > > > > > > > > > Cool. While studying, if you can try to think whether this approach is > > > different from the global coordinat

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-07-22 Thread Amit Kapila
On Wed, Jul 22, 2020 at 4:55 PM Dilip Kumar wrote: > > You are right. I have changed it. > Thanks, I have pushed the second patch in this series which is 0001-WAL-Log-invalidations-at-command-end-with-wal_le in your latest patch. I will continue working on remaining patches. -- With Regards,

Re: Parallel copy

2020-07-22 Thread Ashutosh Sharma
I think, when doing the performance testing for partitioned table, it would be good to also mention about the distribution of data in the input file. One possible data distribution could be that we have let's say 100 tuples in the input file, and every consecutive tuple belongs to a different parti

RE: Global snapshots

2020-07-22 Thread tsunakawa.ta...@fujitsu.com
Hello, While I'm thinking of the following issues of the current approach Andrey raised, I'm getting puzzled and can't help asking certain things. Please forgive me if I'm missing some discussions in the past. > 1. Dependency on clocks synchronization > 2. Needs guarantees of monotonically inc

Re: Implement UNLOGGED clause for COPY FROM

2020-07-22 Thread Amit Kapila
On Wed, Jul 22, 2020 at 11:11 AM osumi.takami...@fujitsu.com wrote: > > > If you are going to suggest users not to replicate such tables then why > > can't you > > suggest them to create such tables as UNLOGGED in the first place? Another > > idea could be that you create an 'unlogged' > > table

Re: Parallel copy

2020-07-22 Thread Amit Kapila
On Thu, Jul 23, 2020 at 8:51 AM Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > On Wed, Jul 22, 2020 at 7:56 PM vignesh C wrote: > > > > Thanks for reviewing and providing the comments Ashutosh. > > Please find my thoughts below: > > > > On Fri, Jul 17, 2020 at 7:18 PM Ashuto

Re: [PATCH] keep the message consistent in buffile.c

2020-07-22 Thread Thomas Munro
On Thu, Jul 23, 2020 at 3:24 PM Lu, Chenyang wrote: > When I analyze this commit: > > https://github.com/postgres/postgres/commit/7897e3bb902c557412645b82120f4d95f7474906 > > I noticed that the message was not consistent with the previous one in > ‘src/backend/storage/file/buffile.c’ > > To keep

[PATCH] keep the message consistent in buffile.c

2020-07-22 Thread Lu, Chenyang
Hi,hackers When I analyze this commit: https://github.com/postgres/postgres/commit/7897e3bb902c557412645b82120f4d95f7474906 I noticed that the message was not consistent with the previous one in ‘src/backend/storage/file/buffile.c’ To keep the message consistent, I made the patch. See the attac

Re: Parallel copy

2020-07-22 Thread Bharath Rupireddy
On Wed, Jul 22, 2020 at 7:56 PM vignesh C wrote: > > Thanks for reviewing and providing the comments Ashutosh. > Please find my thoughts below: > > On Fri, Jul 17, 2020 at 7:18 PM Ashutosh Sharma wrote: > > > > Some review comments (mostly) from the leader side code changes: > > > > 3) Should we

Re: Default setting for enable_hashagg_disk

2020-07-22 Thread Peter Geoghegan
On Tue, Jul 21, 2020 at 1:30 PM Bruce Momjian wrote: > On Tue, Jul 14, 2020 at 03:49:40PM -0700, Peter Geoghegan wrote: > > Maybe I missed your point here. The problem is not so much that we'll > > get HashAggs that spill -- there is nothing intrinsically wrong with > > that. While it's true that

Re: expose parallel leader in CSV and log_line_prefix

2020-07-22 Thread Michael Paquier
On Wed, Jul 22, 2020 at 08:59:04PM -0400, Tom Lane wrote: > Is "NULL" really le mot juste here? If we're talking about text strings, > as the thread title implies (I've not read the patch), then I think you > should say "empty string", because the SQL concept of null doesn't apply. Sorry for the

Re: expose parallel leader in CSV and log_line_prefix

2020-07-22 Thread Tom Lane
Michael Paquier writes: > On Wed, Jul 22, 2020 at 11:36:05AM -0400, Alvaro Herrera wrote: >> How about we combine both. "Process ID of the parallel group leader, if >> this process is a parallel query worker. NULL if this process is a >> parallel group leader or does not participate in parallel

Re: expose parallel leader in CSV and log_line_prefix

2020-07-22 Thread Michael Paquier
On Wed, Jul 22, 2020 at 11:36:05AM -0400, Alvaro Herrera wrote: > How about we combine both. "Process ID of the parallel group leader, if > this process is a parallel query worker. NULL if this process is a > parallel group leader or does not participate in parallel query". Sounds fine to me. T

Re: [Patch] ALTER SYSTEM READ ONLY

2020-07-22 Thread Soumyadeep Chakraborty
Hi Amul, On Tue, Jun 16, 2020 at 6:56 AM amul sul wrote: > The proposed feature is built atop of super barrier mechanism commit[1] to > coordinate > global state changes to all active backends. Backends which executed > ALTER SYSTEM READ { ONLY | WRITE } command places request to checkpointer >

Re: Why it is not possible to create custom AM which behaves similar to btree?

2020-07-22 Thread Tom Lane
Konstantin Knizhnik writes: > But then I get error for btfloat48cmp and btfloat84cmp functions: > ERROR: associated data types must be specified for index support function You need to specify the amproclefttype and amprocrighttype types you want the function to be registered under. The core cod

Re: Infinities in type numeric

2020-07-22 Thread Tom Lane
Dean Rasheed writes: > On Tue, 21 Jul 2020 at 23:18, Tom Lane wrote: >> Here's a v4 that syncs numeric in_range() with the new behavior of >> float in_range(), and addresses your other comments too. > LGTM. Pushed. Thanks again for reviewing! regards, tom lane

Why it is not possible to create custom AM which behaves similar to btree?

2020-07-22 Thread Konstantin Knizhnik
Hi hackers. I tried to create LSM AM which can be used instead of nbtree. I looked at contrib/btree/gin, contrib/isn and try to do the following: CREATE OPERATOR FAMILY lsm3_float_ops USING lsm3; CREATE OPERATOR CLASS float4_ops DEFAULT     FOR TYPE float4 USING lsm3 FAMILY lsm3_float_ops AS   

Re: [Patch] ALTER SYSTEM READ ONLY

2020-07-22 Thread SATYANARAYANA NARLAPURAM
+1 to this feature and I have been thinking about it for sometime. There are several use cases with marking database read only (no transaction log generation). Some of the examples in a hosted service scenario are 1/ when customer runs out of storage space, 2/ Upgrading the server to a different ma

Re: [Patch] ALTER SYSTEM READ ONLY

2020-07-22 Thread Soumyadeep Chakraborty
Hello, I think we should really term this feature, as it stands, as a means to solely stop WAL writes from happening. The feature doesn't truly make the system read-only (e.g. dirty buffer flushes may succeed the system being put into a read-only state), which does make it confusing to a degree.

Re: Infinities in type numeric

2020-07-22 Thread Dean Rasheed
On Tue, 21 Jul 2020 at 23:18, Tom Lane wrote: > > Here's a v4 that syncs numeric in_range() with the new behavior of > float in_range(), and addresses your other comments too. > LGTM. Regards, Dean

Re: OpenSSL randomness seeding

2020-07-22 Thread Daniel Gustafsson
> On 22 Jul 2020, at 07:00, Noah Misch wrote: > > On Tue, Jul 21, 2020 at 02:13:32PM +0200, Daniel Gustafsson wrote: >> The silver lining here is that while OpenSSL nooped RAND_cleanup, they also >> changed what is mixed into seeding so we are still not sharing a sequence. >> To >> fix this, ch

Re: [PATCH] fix GIN index search sometimes losing results

2020-07-22 Thread Pavel Borisov
ср, 22 июл. 2020 г. в 19:10, Tom Lane : > Pavel Borisov writes: > > For 0002-remove-calc-not-flag.patch > > The patch changes the behavior which is now considered default. This is > true in RUM module and maybe in some other tsearch side modules. Applying > the patch can make code more beautiful

Re: Default setting for enable_hashagg_disk

2020-07-22 Thread Robert Haas
On Tue, Jul 14, 2020 at 6:49 PM Peter Geoghegan wrote: > Maybe I missed your point here. The problem is not so much that we'll > get HashAggs that spill -- there is nothing intrinsically wrong with > that. While it's true that the I/O pattern is not as sequential as a > similar group agg + sort, t

RE: [PATCH] Keeps tracking the uniqueness with UniqueKey

2020-07-22 Thread Floris Van Nee
Hi Andy, A small thing I found: +static List * +get_exprs_from_uniqueindex(IndexOptInfo *unique_index, + List *const_exprs, +

Re: Parallel Seq Scan vs kernel read ahead

2020-07-22 Thread Soumyadeep Chakraborty
On Tue, Jul 21, 2020 at 9:33 PM Thomas Munro wrote: > > On Wed, Jul 22, 2020 at 3:57 PM Amit Kapila wrote: > > Yeah, that is true but every time before the test the same amount of > > data should be present in shared buffers (or OS cache) if any which > > will help in getting consistent results.

Re: Parallel Seq Scan vs kernel read ahead

2020-07-22 Thread Soumyadeep Chakraborty
Hi David, Apologies for the delay, I had missed these emails. On Tue, Jul 14, 2020 at 8:52 PM David Rowley wrote: > It would be good to know if the > regression is repeatable or if it was affected by some other process. These are the latest results on the same setup as [1]. (TL;DR: the FreeBS

Re: expose parallel leader in CSV and log_line_prefix

2020-07-22 Thread Alvaro Herrera
On 2020-Jul-21, Michael Paquier wrote: > On Mon, Jul 20, 2020 at 11:12:31PM -0500, Justin Pryzby wrote: > >> + Process ID of the parallel group leader if this process is involved > >> + in parallel query, or null. For a parallel group leader, this > >> field > >> + is NULL. >

RE: Parallel Seq Scan vs kernel read ahead

2020-07-22 Thread k.jami...@fujitsu.com
On Wednesday, July 22, 2020 2:21 PM (GMT+9), David Rowley wrote: > On Wed, 22 Jul 2020 at 16:40, k.jami...@fujitsu.com > wrote: > > I used the default max_parallel_workers & max_worker_proceses which is 8 by > default in postgresql.conf. > > IOW, I ran all those tests with maximum of 8 processes

RE: Parallel Seq Scan vs kernel read ahead

2020-07-22 Thread k.jami...@fujitsu.com
On Tuesday, July 21, 2020 7:33 PM, Amit Kapila wrote: > On Tue, Jul 21, 2020 at 3:08 PM k.jami...@fujitsu.com > wrote: > > > > On Tuesday, July 21, 2020 12:18 PM, Amit Kapila wrote: > > > On Tue, Jul 21, 2020 at 8:06 AM k.jami...@fujitsu.com > > > > > > wrote: > > > > > > > > I am definitely miss

Re: [PATCH] fix GIN index search sometimes losing results

2020-07-22 Thread Tom Lane
Pavel Borisov writes: > For 0002-remove-calc-not-flag.patch > The patch changes the behavior which is now considered default. This is true > in RUM module and maybe in some other tsearch side modules. Applying the > patch can make code more beautiful but possibly will not give some > performanc

Re: Parallel copy

2020-07-22 Thread vignesh C
Thanks for reviewing and providing the comments Ashutosh. Please find my thoughts below: On Fri, Jul 17, 2020 at 7:18 PM Ashutosh Sharma wrote: > > Some review comments (mostly) from the leader side code changes: > > 1) Do we need a DSM key for the FORCE_QUOTE option? I think FORCE_QUOTE option i

Re: expose parallel leader in CSV and log_line_prefix

2020-07-22 Thread Julien Rouhaud
On Tue, Jul 21, 2020 at 6:33 AM Michael Paquier wrote: > > On Mon, Jul 20, 2020 at 11:12:31PM -0500, Justin Pryzby wrote: > > On Tue, Jul 21, 2020 at 12:51:45PM +0900, Michael Paquier wrote: > > The documentation could talk about either: > > > > 1) "lock group leader" - low-level, raw view of the

Re: [Proposal] Global temporary tables

2020-07-22 Thread wenjing zeng
> 2020年7月14日 下午10:28,Pavel Stehule 写道: > > > > pá 10. 7. 2020 v 11:04 odesílatel wenjing zeng > napsal: > HI all > > I started using my personal email to respond to community issue. > > > >> 2020年7月7日 下午6:05,Pavel Stehule > > 写

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-07-22 Thread Amit Kapila
On Wed, Jul 22, 2020 at 10:20 AM Dilip Kumar wrote: > > On Wed, Jul 22, 2020 at 9:18 AM Amit Kapila wrote: > > > > On Mon, Jul 20, 2020 at 6:46 PM Dilip Kumar wrote: > > > > > > There was one warning in release mode in the last version in 0004 so > > > attaching a new version. > > > > > > > Toda

Re: [POC] Fast COPY FROM command for the table with foreign partitions

2020-07-22 Thread Andrey V. Lepikhov
On 7/16/20 2:14 PM, Amit Langote wrote: Hi Andrey, Thanks for this work. I have been reading through your patch and here's a what I understand it does and how: The patch aims to fix the restriction that COPYing into a foreign table can't use multi-insert buffer mechanism effectively. That's b

Re: Parallel Seq Scan vs kernel read ahead

2020-07-22 Thread David Rowley
On Wed, 22 Jul 2020 at 18:17, k.jami...@fujitsu.com wrote: > Even though I read the documentation [1][2] on parallel query, I might not > have > understood it clearly yet. So thank you very much for explaining simpler how > the > relation size, GUCs, and reloption affect the query planner's beha

Re: Using Valgrind to detect faulty buffer accesses (no pin or buffer content lock held)

2020-07-22 Thread Georgios
‐‐‐ Original Message ‐‐‐ On Tuesday, July 21, 2020 11:52 PM, Peter Geoghegan wrote: > On Mon, Jul 6, 2020 at 1:35 AM Georgios Kokolatos > gkokola...@protonmail.com wrote: > > > As a general overview, the series of patches in the mail thread do match > > their description. The addition

Re: Is it useful to record whether plans are generic or custom?

2020-07-22 Thread torikoshia
On 2020-07-20 13:57, torikoshia wrote: As I proposed earlier in this thread, I'm now trying to add information about generic/cudstom plan to pg_stat_statements. I'll share the idea and the poc patch soon. Attached a poc patch. Main purpose is to decide (1) the user interface and (2) the way t