Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fPhnp-00012e-4H for pgsql-general@arkaria.postgresql.org; Mon, 04 Jun 2018 05:13:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fPhno-0004YD-0Q for pgsql-general@arkaria.postgresql.org; Mon, 04 Jun 2018 05:13:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fPhnn-0004Y4-P4 for pgsql-general@lists.postgresql.org; Mon, 04 Jun 2018 05:13:07 +0000 Received: from 9v6.net-wizard.org ([2a01:4f8:172:2a5c::9] helo=gandalf.net-wizard.org) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fPhnf-0002Gx-DU for pgsql-general@lists.postgresql.org; Mon, 04 Jun 2018 05:13:06 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.net-wizard.org (Postfix) with ESMTP id 7BC2D808E1; Mon, 4 Jun 2018 07:12:56 +0200 (CEST) X-Virus-Scanned: Gentoo amavisd-new at aragorn Received: from aragorn.net-wizard.org ([127.0.0.1]) by localhost (aragorn.net-wizard.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Kc5HMcp0eb-y; Mon, 4 Jun 2018 07:12:53 +0200 (CEST) Received: from MTEC0211 (mtec-lee-dock-2-133.ethz.ch [129.132.6.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: clavadetscher@swisspug.org) by gandalf.net-wizard.org (Postfix) with ESMTPSA id 773A3808DF; Mon, 4 Jun 2018 07:12:49 +0200 (CEST) From: "Charles Clavadetscher" To: "'Melvin Davidson'" Cc: "'pgsql-generallists.postgresql.org'" References: <024f01d3f89e$323e20d0$96ba6270$@swisspug.org> In-Reply-To: Subject: RE: Question on disk contention Date: Mon, 4 Jun 2018 07:12:42 +0200 Message-ID: <002401d3fbc2$b0ce3e90$126abbb0$@swisspug.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0025_01D3FBD3.74570E90" X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQF1HJD5lKbohp+zS/ia8rqJJhbCCgLidmYwpPY4LuA= Content-Language: de-ch List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multipart message in MIME format. ------=_NextPart_000_0025_01D3FBD3.74570E90 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Melvin =20 From: Melvin Davidson [mailto:melvin6925@gmail.com]=20 Sent: Donnerstag, 31. Mai 2018 15:53 To: Charles Clavadetscher Cc: pgsql-generallists.postgresql.org = Subject: Re: Question on disk contention =20 =20 =20 On Thu, May 31, 2018 at 1:13 AM, Charles Clavadetscher = > wrote: Hi Melvin As an answer to a previous post you wrote: "Also, your main problem is that when you have two exact same queries = executing at the same time, they will cause contention in the disk, and neither one will make much progress." Could you elaborate a little more on the meaning of "contention in the = disk"? What is it that happens? Thank you and have a good day. Regards Charles >Could you elaborate a little more on the meaning of "contention in the = disk"? >What is it that happens?=20 =20 To simplify, you have two users/jobs, both wanting the exact same = information. So the system instructs the disk to get=20 that information from the disk, which causes the disk head to "seek" to = the position of the first eligible row and=20 continues positioning to other eligible rows. Now the job is not = exclusive, so the system temporarily switches to the other job, which causes the disk to go back to the first row and work = from there. The switching back and forth continues, so that instead of one job finishing quickly, they both have to take = turns waiting for needed information. That takes a lot longer, =20 Try this, Select a table that has a lot of rows, ideally 1M+. Then start = a query with a WHERE clause and see how long it takes. Then submit the same query from 5 separate connections = simultaneously and see how long that takes. =20 Thank you very much for your answer. Regards Charles =20 --=20 Melvin Davidson Maj. Database & Exploration Specialist Universe Exploration Command =E2=80=93 UXC Employment by invitation only!=20 ------=_NextPart_000_0025_01D3FBD3.74570E90 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

Hi = Melvin

 

From:<= /b> Melvin = Davidson [mailto:melvin6925@gmail.com]
Sent: Donnerstag, 31. =
Mai 2018 = 15:53
To: Charles Clavadetscher = <clavadetscher@swisspug.org>
Cc: = pgsql-generallists.postgresql.org = <pgsql-general@lists.postgresql.org>
Subject: Re: = Question on disk contention

 

 

 

On Thu, = May 31, 2018 at 1:13 AM, Charles Clavadetscher <clavadetscher@swisspug.org> = wrote:

Hi Melvin

As an answer to a = previous post you wrote:

"Also, your main problem is that = when you have two exact same queries executing at the same time, they = will cause contention in
the disk, and neither one will make much = progress."

Could you elaborate a little more on the meaning = of "contention in the disk"?
What is it that = happens?

Thank you and have a good day.
Regards
Charles

=


>Could you elaborate a little more on the = meaning of "contention in the disk"?
>What is it that = happens?

 

To simplify, you have two users/jobs, both wanting the = exact same information. So the system instructs the disk to get =

that information from the = disk, which causes the disk head to "seek" to the position of = the first eligible row and

continues positioning to other eligible rows. Now the = job is not exclusive, so the system temporarily switches to = the

other job, which = causes the disk to go back to the first row and work from there. The = switching back and forth continues,

so that instead of one job finishing quickly, they = both have to take turns waiting for needed information. That = takes

a lot = longer,

 

Try this, Select a table that has a lot of rows, = ideally 1M+. Then start a query with a WHERE clause and see how = long

it takes. Then submit = the same query from 5 separate connections simultaneously and see how = long that takes.

 

Thank = you very much for your answer.

Regards

Charles

 


-- =

Melvin = Davidson
Maj. Database & = Exploration Specialist

Universe Exploration Command =E2=80=93 = UXC

Employment by invitation = only!
=

------=_NextPart_000_0025_01D3FBD3.74570E90--