Re: Zero throughput on a query on a very large table.

2019-01-25 Thread l...@laurent-hasson.com
From: Tom Lane Sent: Friday, January 25, 2019 3:04:37 PM To: l...@laurent-hasson.com Cc: pgsql-performa...@postgresql.org Subject: Re: Zero throughput on a query on a very large table. "l...@laurent-hasson.com" writes: > Second, here is what i found and what messed us up. >

Re: Zero throughput on a query on a very large table.

2019-01-25 Thread Tom Lane
"l...@laurent-hasson.com" writes: > Second, here is what i found and what messed us up. > select current_setting('random_page_cost'); --> 4 > alter database "CMS_TMP" set random_page_cost=0.0001; > select current_setting('random_page_cost'); --> 4 ALTER DATABASE only affects

Re: Zero throughput on a query on a very large table.

2019-01-25 Thread l...@laurent-hasson.com
here? Thank you, Laurent. From: l...@laurent-hasson.com Sent: Friday, January 25, 2019 2:06:54 PM To: Tom Lane Cc: pgsql-performa...@postgresql.org Subject: Re: Zero throughput on a query on a very large table. OK... I think we may have cracked this. First, d

Re: Zero throughput on a query on a very large table.

2019-01-25 Thread l...@laurent-hasson.com
nsaction. I have to change it globally which i would prefer not to do. Any help here? Thanks, Laurent. ____ From: l...@laurent-hasson.com Sent: Friday, January 25, 2019 1:36:21 PM To: Tom Lane Cc: pgsql-performa...@postgresql.org Subject: Re: Zero throughput on a qu

Re: Zero throughput on a query on a very large table.

2019-01-25 Thread l...@laurent-hasson.com
@postgresql.org Subject: Re: Zero throughput on a query on a very large table. "l...@laurent-hasson.com" writes: > Also, the original statement i implemented did not have all of that. This is > the normalized SQL that Postgres now gives when looking at the indices. [ squint...

Re: Zero throughput on a query on a very large table.

2019-01-25 Thread Tom Lane
"l...@laurent-hasson.com" writes: > Also, the original statement i implemented did not have all of that. This is > the normalized SQL that Postgres now gives when looking at the indices. [ squint... ] What do you mean exactly by "Postgres gives that"? I don't see any redundant COLLATE clauses i

Re: Zero throughput on a query on a very large table.

2019-01-25 Thread l...@laurent-hasson.com
org Subject: Re: Zero throughput on a query on a very large table. "l...@laurent-hasson.com" writes: > The indices are defined as: > CREATE INDEX i_outprev_ptclaim > ON public.tmp_outpatient_rev USING btree > (desy_sort_key COLLATE pg_catalog."default

Re: Zero throughput on a query on a very large table.

2019-01-25 Thread l...@laurent-hasson.com
ane Cc: l...@laurent-hasson.com; pgsql-performa...@postgresql.org Subject: Re: Zero throughput on a query on a very large table. On Fri, 25 Jan 2019 at 19:24, Tom Lane wrote: > PS: On the third hand, you mention having created new indexes on this > table with apparently not a lot of pain, which is

Re: Zero throughput on a query on a very large table.

2019-01-25 Thread Tom Lane
"l...@laurent-hasson.com" writes: > The indices are defined as: > CREATE INDEX i_outprev_ptclaim > ON public.tmp_outpatient_rev USING btree > (desy_sort_key COLLATE pg_catalog."default", claim_no COLLATE > pg_catalog."default") > TABLESPACE pg_default; > CREATE UNIQUE INDEX ui_outpr

Re: Zero throughput on a query on a very large table.

2019-01-25 Thread l...@laurent-hasson.com
(a few secs). From: Tom Lane Sent: Friday, January 25, 2019 1:24:45 AM To: l...@laurent-hasson.com Cc: pgsql-performa...@postgresql.org Subject: Re: Zero throughput on a query on a very large table. "l...@laurent-hasson.com" writes: > Query: >

RE: Zero throughput on a query on a very large table.

2019-01-25 Thread l...@laurent-hasson.com
> -Original Message- > From: Andreas Kretschmer > Sent: Friday, January 25, 2019 00:55 > To: pgsql-performance@lists.postgresql.org > Subject: Re: Zero throughput on a query on a very large table. > > > > Am 25.01.19 um 06:20 schrieb l...@laurent-hasson.com

Re: Zero throughput on a query on a very large table.

2019-01-24 Thread David Rowley
On Fri, 25 Jan 2019 at 19:24, Tom Lane wrote: > PS: On the third hand, you mention having created new indexes on this > table with apparently not a lot of pain, which is a tad surprising > if you don't have the patience to wait for a sort to finish. How > long did those index builds take? It wou

Re: Zero throughput on a query on a very large table.

2019-01-24 Thread Tom Lane
"l...@laurent-hasson.com" writes: > Query: > select * from tmp_outpatient_rev order by desy_sort_key, claim_no > Plan: > [ seqscan-and-sort ... parallelized, but still seqscan-and-sort ] > - I have tried to hack the planner to force an index scan (which would > avoid the sort/gather st

Re: Zero throughput on a query on a very large table.

2019-01-24 Thread Andreas Kretschmer
Am 25.01.19 um 06:20 schrieb l...@laurent-hasson.com: Hello, We have been stuck for the past week on a query that simply won’t “execute”. We have a table with 1.2B rows that took around 14h to load, but a simple select takes forever and after 10h, no records are coming through still. En

Zero throughput on a query on a very large table.

2019-01-24 Thread l...@laurent-hasson.com
Hello, We have been stuck for the past week on a query that simply won’t “execute”. We have a table with 1.2B rows that took around 14h to load, but a simple select takes forever and after 10h, no records are coming through still. Environment: - Table tmp_outpatient_rev with 41 VARCHA