Re: Explain says 8 workers planned, only 1 executed

2020-03-21 Thread Tom Lane
Alastair McKinley writes: > Thanks for solving the mystery. I think this might be a missing point in > section 15.2 in the docs. > I wonder will this ever be improved or should I just write to temporary > tables instead of return query? I just posted a patch to improve that [1], but it's not s

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread pabloa98
On Sat, Mar 21, 2020 at 4:37 PM Adrian Klaver wrote: > > > Anyway, It will be awesome if we have a sequence data type in a future > > version of postgresql. They will solve a lot of problems similar to this > > one. > > Actually there are already two: > > https://www.postgresql.org/docs/12/dataty

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread Adrian Klaver
On 3/21/20 1:45 PM, pabloa98 wrote: On Sat, Mar 21, 2020 at 12:08 PM Peter J. Holzer > wrote: And I think that "care about gaps -> sequence doesn't work" is a knee-jerk reaction. It's similar to "can't parse HTML with regexps". True in the general case,

Re: Duplicate key violation on upsert

2020-03-21 Thread Matt Magoffin
> On 22/03/2020, at 8:11 AM, Adrian Klaver wrote: > >> I was thinking more about this: >> "INSERT INTO solardatum.da_datum(ts, node_id, source_id, posted, jdata_i, >> jdata_a, jdata_s, jdata_t) >> VALUES (…) ..." >> from your OP. Namely whether it was: >> VALUES (), (), (), ... >> and if so

Re: Explain says 8 workers planned, only 1 executed

2020-03-21 Thread Alastair McKinley
Hi Jeremy, Thanks for solving the mystery. I think this might be a missing point in section 15.2 in the docs. I wonder will this ever be improved or should I just write to temporary tables instead of return query? Best regards, Alastair From: Jeremy Smith Se

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread Rob Sargent
> On Mar 21, 2020, at 1:13 PM, Peter J. Holzer wrote: > > On 2020-03-21 12:55:33 -0600, Rob Sargent wrote: >> To me the description of the ID smacks of database-in-the-name folly. I >> recognize that OP is likely unable to take another path. I’ll not push this >> any >> further. > > Identif

Re: Explain says 8 workers planned, only 1 executed

2020-03-21 Thread Jeremy Smith
Unfortunately, return query will never use parallel workers. See: https://stackoverflow.com/q/58079898/895640 and https://www.postgresql.org/message-id/16040-eaacad11fecfb...@postgresql.org On Sat, Mar 21, 2020 at 1:59 PM Alastair McKinley < a.mckin...@analyticsengines.com> wrote: > Hi Adrian, >

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread pabloa98
On Sat, Mar 21, 2020 at 12:08 PM Peter J. Holzer wrote: > > > And I think that "care about gaps -> sequence doesn't work" is a > knee-jerk reaction. It's similar to "can't parse HTML with regexps". > True in the general case, and therefore people tend to blurt it out > every time the topic comes

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread Peter J. Holzer
On 2020-03-21 12:55:33 -0600, Rob Sargent wrote: > To me the description of the ID smacks of database-in-the-name folly. I > recognize that OP is likely unable to take another path. I’ll not push this > any > further. Identifiers often have internal structure. In Austria for example, the social

Re: Duplicate key violation on upsert

2020-03-21 Thread Adrian Klaver
On 3/21/20 11:05 AM, Adrian Klaver wrote: On 3/20/20 1:32 PM, Matt Magoffin wrote: On 21/03/2020, at 8:10 AM, Adrian Klaver > wrote: The _hyper_1_1931_chunk_da_datum_x_acc_idx index has the same definition as the da_datum_x_acc_idx above (it is defined on a

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread Peter J. Holzer
On 2020-03-20 17:53:11 -0700, Adrian Klaver wrote: > On 3/20/20 4:29 PM, Peter J. Holzer wrote: > > On 2020-03-20 17:11:42 -0600, Rob Sargent wrote: > > > On Mar 20, 2020, at 4:59 PM, Peter J. Holzer wrote: > > > > On 2020-03-19 16:48:19 -0700, David G. Johnston wrote: > > > > > First, it sounds l

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread Rob Sargent
> On Mar 21, 2020, at 12:18 PM, pabloa98 wrote: > >  > >> Why? "Print" and "screen" forms have all sorts of practical restrictions >> like this. >> > Legacy I guess. These are all digital stuff. But the final result is an > identifier that people can read and realize what they are talking

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread pabloa98
> Why? "Print" and "screen" forms have all sorts of practical restrictions > like this. > > Legacy I guess. These are all digital stuff. But the final result is an identifier that people can read and realize what they are talking about. Pablo

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread pabloa98
On Fri, Mar 20, 2020 at 9:04 PM John W Higgins wrote: > > > On Fri, Mar 20, 2020 at 8:13 PM pabloa98 wrote: > >> >> I hope I described the problem completely. >> >> > 1) What is a group - does it exist prior to records being inserted? How > many groups are you working with? How long do they live

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread pabloa98
> > As to below that is going to require more thought. > > > Still no word on the actual requirement. As someone who believes > consecutive numbers on digital invoices is simply a mistaken interpretation > of the paper based system, I suspect a similar error here. But again we > haven’t really hear

Re: Duplicate key violation on upsert

2020-03-21 Thread Adrian Klaver
On 3/20/20 1:32 PM, Matt Magoffin wrote: On 21/03/2020, at 8:10 AM, Adrian Klaver > wrote: The _hyper_1_1931_chunk_da_datum_x_acc_idx index has the same definition as the da_datum_x_acc_idx above (it is defined on a child table). That is, they are both essen

Re: Explain says 8 workers planned, only 1 executed

2020-03-21 Thread Alastair McKinley
Hi Adrian, Thanks for getting back to me. Postgres version is: PostgreSQL 11.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit I simplified it to the following structure: create function f() returns setof my_type as $$ declare q text; output text; begin

Re: Explain says 8 workers planned, only 1 executed

2020-03-21 Thread Adrian Klaver
On 3/21/20 10:25 AM, Alastair McKinley wrote: Hi all, I have a long running query that I have tweaked along with config (e.g. min_parallel_table_scan_size) to execute nicely and very fast in parallel which works as expected executed directly from psql client. The query is then embedded in a

Explain says 8 workers planned, only 1 executed

2020-03-21 Thread Alastair McKinley
Hi all, I have a long running query that I have tweaked along with config (e.g. min_parallel_table_scan_size) to execute nicely and very fast in parallel which works as expected executed directly from psql client. The query is then embedded in a psql function like "return query select * from

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread Ron
On 3/21/20 12:02 PM, Rob Sargent wrote: On Mar 21, 2020, at 10:47 AM, Adrian Klaver wrote: On 3/20/20 8:13 PM, pabloa98 wrote: Nothing I saw that said int could not become bigint. My bad. The code cannot be a bigint. Or it could be a bigint between 1 to :) Aah, that was the cou

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread Rob Sargent
> On Mar 21, 2020, at 10:47 AM, Adrian Klaver wrote: > > On 3/20/20 8:13 PM, pabloa98 wrote: >>Nothing I saw that said int could not become bigint. >> My bad. The code cannot be a bigint. Or it could be a bigint between 1 to >> :) > > > Aah, that was the counter Peter was talk

Re: Could postgres12 support millions of sequences? (like 10 million)

2020-03-21 Thread Adrian Klaver
On 3/20/20 8:13 PM, pabloa98 wrote: Nothing I saw that said int could not become bigint. My bad. The code cannot be a bigint. Or it could be a bigint between 1 to :) Aah, that was the counter Peter was talking about. I missed that. As to below that is going to require more th