Re: bug in pageinspect's "tuple data" feature

2020-11-22 Thread Heikki Linnakangas
On 21/11/2020 21:32, Alvaro Herrera wrote: If you have a sufficiently broken data page, pageinspect throws an error when trying to examine the page: ERROR: invalid memory alloc request size 18446744073709551451 This is pretty unhelpful; it would be better not to try to print the data instead o

Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

2020-11-22 Thread Bharath Rupireddy
> > Here is how I'm making 4 separate patches: > > 1. new function and it's documentation. > 2. GUC and it's documentation. > 3. server level option and it's documentation. > 4. test cases for all of the above patches. > Hi, I'm attaching the patches here. Note that, though the code changes for th

Re: Parallel plans and "union all" subquery

2020-11-22 Thread Greg Nancarrow
On Sun, Nov 22, 2020 at 11:51 PM Phil Florent wrote: > > > Hi, > > > I have a question about parallel plans. I also posted it on the general list > but perhaps it's a question for hackers. Here is my test case : > > > explain > select count(*) > from (select > n1 > from drop_me > union all > valu

Re: PoC/WIP: Extended statistics on expressions

2020-11-22 Thread Tomas Vondra
On 11/23/20 3:26 AM, Justin Pryzby wrote: > On Sun, Nov 22, 2020 at 08:03:51PM +0100, Tomas Vondra wrote: >> attached is a significantly improved version of the patch, allowing >> defining extended statistics on expressions. This fixes most of the >> problems in the previous WIP version and AFAI

RE: Disable WAL logging to speed up data loading

2020-11-22 Thread tsunakawa.ta...@fujitsu.com
From: Osumi, Takamichi/大墨 昂道 > This time, I updated my patch to address comments below only. I forgot to mentionthis. I confirmed all review comments are reflected correctly. Regards Takayuki Tsunakawa

RE: Disable WAL logging to speed up data loading

2020-11-22 Thread tsunakawa.ta...@fujitsu.com
From: Osumi, Takamichi/大墨 昂道 > > case TRANS_STMT_PREPARE: > > + if (wal_level == > > WAL_LEVEL_NONE) > > + ereport(ERROR, > > + > > errmsg("cannot execute PREPARE TRA

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

2020-11-22 Thread tsunakawa.ta...@fujitsu.com
Hi Andrey-san, From: Tomas Vondra > I needed to look at this patch while working on something related, and I > found it > got broken by 6973533650c a couple days ago. So here's a fixed version, to > keep > cfbot happy. I haven't done any serious review yet. Could I or my colleague continue thi

RE: POC: postgres_fdw insert batching

2020-11-22 Thread tsunakawa.ta...@fujitsu.com
From: Tomas Vondra > I don't think this is usable in practice, because a single session may > be using multiple FDW servers, with different implementations, latency > to the data nodes, etc. It's unlikely a single GUC value will be > suitable for all of them. That makes sense. The row size varie

Re: [PoC] Non-volatile WAL buffer

2020-11-22 Thread Tomas Vondra
Hi, On 10/30/20 6:57 AM, Takashi Menjo wrote: > Hi Heikki, > >> I had a new look at this thread today, trying to figure out where >> we are. > > I'm a bit confused. >> >> One thing we have established: mmap()ing WAL files performs worse >> than the current method, if pg_wal is not on a persis

Re: [PoC] Non-volatile WAL buffer

2020-11-22 Thread Tomas Vondra
Hi, These patches no longer apply :-( A rebased version would be nice. I've been interested in what performance improvements this might bring, so I've been running some extensive benchmarks on a machine with PMEM hardware. So let me share some interesting results. (I used commit from early Septem

Re: [doc] improve tableoid description

2020-11-22 Thread Ian Lawrence Barwick
2020年11月21日(土) 16:29 Peter Eisentraut : > > On 2020-10-19 14:28, Ian Lawrence Barwick wrote: > > On further reflection, I think trying to explain all that is going to > > end up as a > > mini-tutorial which is beyond the scope of the explanation of a column, so > > the existing reference to pg_clas

Re: Bogus documentation for bogus geometric operators

2020-11-22 Thread Tom Lane
Pavel Borisov writes: >> undocumented. Maybe instead of removing, change the text to be >> "Deprecated, use the equivalent XXX operator instead." Or we could >> add a footnote similar to what was there for a previous renaming: > The problem that this new <<| is equivalent to <^ only for points

Re: Why does create_gather_merge_plan need make_sort?

2020-11-22 Thread Tomas Vondra
On 11/22/20 10:31 PM, Tom Lane wrote: > Tomas Vondra writes: >> On 11/20/20 11:24 PM, James Coleman wrote: >>> While looking at another issue I noticed that create_gather_merge_plan >>> calls make_sort if the subplan isn't sufficiently sorted. In all of >>> the cases I've seen where a gather merge

Re: Fix generate_useful_gather_paths for parallel unsafe pathkeys

2020-11-22 Thread Tomas Vondra
On 11/21/20 2:55 AM, James Coleman wrote: > Over on the -bugs list we had a report [1] of a seg fault with > incremental sort. The short of the investigation there was that a > subplan wasn't being serialized since it wasn't parallel safe, and > that attempting to initialize that subplan resulted i

Re: Why does create_gather_merge_plan need make_sort?

2020-11-22 Thread Tom Lane
Tomas Vondra writes: > On 11/20/20 11:24 PM, James Coleman wrote: >> While looking at another issue I noticed that create_gather_merge_plan >> calls make_sort if the subplan isn't sufficiently sorted. In all of >> the cases I've seen where a gather merge path (not plan) is created >> the input pat

Re: Why does create_gather_merge_plan need make_sort?

2020-11-22 Thread Tomas Vondra
On 11/20/20 11:24 PM, James Coleman wrote: > While looking at another issue I noticed that create_gather_merge_plan > calls make_sort if the subplan isn't sufficiently sorted. In all of > the cases I've seen where a gather merge path (not plan) is created > the input path is expected to be properly

Re: [bug+patch] Inserting DEFAULT into generated columns from VALUES RTE

2020-11-22 Thread Tom Lane
Dean Rasheed writes: > I think it's actually easier to just do it all in the rewriter -- at > the point where we see that we're about to insert potentially illegal > values from a VALUES RTE into a generated column, scan it to see if > all the values in that column are DEFAULTs, and if so trigger

Re: More time spending with "delete pending"

2020-11-22 Thread Alexander Lakhin
19.11.2020 01:28, Tom Lane wrote: > Alexander Lakhin writes: >> 18.11.2020 23:39, Tom Lane wrote: >>> Now, the ones on the 10 and 11 branches are all from pg_ctl, which >>> does not use pgwin32_open() in those branches, only native open(). >>> So those aren't fair to count against it. But we have

Re: Hybrid Hash/Nested Loop joins and caching results from subplans

2020-11-22 Thread Andy Fan
On Sun, Nov 22, 2020 at 9:21 PM Andy Fan wrote: > Hi David: > > I did a review on the v8, it looks great to me. Here are some tiny > things noted, > just FYI. > > 1. modified src/include/utils/selfuncs.h > @@ -70,9 +70,9 @@ > * callers to provide further details about some assumptions whic

Re: Hybrid Hash/Nested Loop joins and caching results from subplans

2020-11-22 Thread Andy Fan
Hi David: I did a review on the v8, it looks great to me. Here are some tiny things noted, just FYI. 1. modified src/include/utils/selfuncs.h @@ -70,9 +70,9 @@ * callers to provide further details about some assumptions which were made * during the estimation. */ -#define SELFLAG_USED_

Parallel plans and "union all" subquery

2020-11-22 Thread Phil Florent
Hi, I have a question about parallel plans. I also posted it on the general list but perhaps it's a question for hackers. Here is my test case : select version(); version

Re: Removal of currtid()/currtid2() and some table AM cleanup

2020-11-22 Thread Michael Paquier
On Sat, Nov 21, 2020 at 09:39:28PM -0500, Tom Lane wrote: > Michael Paquier writes: >> So, what you are basically saying is to switch currtid_byreloid() to >> become a function local to tid.c. And then have just >> currtid_byrelname() and currtid_for_view() call that, right? > > Yeah, that sound

Re: Issue with server side statement-level rollback

2020-11-22 Thread Gilles Darold
Le 20/11/2020 à 16:18, Gilles Darold a écrit : > I will work later on a POC to demonstrate the use case I want to > implement. Hi Andres, I have created a new version of the pg_statement_rollback extension [1] to demonstrate the use of the hooks on start_xact_command(), finish_xact_command() a

[PATCH 1/1] Initial mach based shared memory support.

2020-11-22 Thread James Hilliard
OSX implements sysv shmem support via a mach wrapper, however the mach sysv shmem wrapper has some severe restrictions that prevent us from allocating enough memory segments in some cases. These limits appear to be due to the way the wrapper itself is implemented and not mach. For example when ru