pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Charles Clavadetscher <clavadetscher@swisspug.org>
To: 'Melvin Davidson' <melvin6925@gmail.com>
Cc: 'pgsql-generallists.postgresql.org' <pgsql-general@lists.postgresql.org>
Subject: RE: Question on disk contention
Date: Mon, 4 Jun 2018 07:12:42 +0200
Message-ID: <002401d3fbc2$b0ce3e90$126abbb0$@swisspug.org> (raw)
In-Reply-To: <CANu8FizOv1O7+kwGePNa+DNZtXL0aNBeSV3YdpENKo7a4zjZAg@mail.gmail.com>
References: <024f01d3f89e$323e20d0$96ba6270$@swisspug.org>
	<CANu8FizOv1O7+kwGePNa+DNZtXL0aNBeSV3YdpENKo7a4zjZAg@mail.gmail.com>

Hi Melvin

 

From: 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 <mailto: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 – UXC
Employment by invitation only! 

view thread (8+ messages)

Message-ID: <002401d3fbc2$b0ce3e90$126abbb0$@swisspug.org>
Permalink:  ../002401d3fbc2$b0ce3e90$126abbb0$@swisspug.org/
Also on:    postgresql.org/message-id/002401d3fbc2$b0ce3e90$126abbb0$@swisspug.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: clavadetscher@swisspug.org, melvin6925@gmail.com
  Subject: Re: Question on disk contention
  In-Reply-To: <002401d3fbc2$b0ce3e90$126abbb0$@swisspug.org>
  References: <024f01d3f89e$323e20d0$96ba6270$@swisspug.org> <CANu8FizOv1O7+kwGePNa+DNZtXL0aNBeSV3YdpENKo7a4zjZAg@mail.gmail.com> <002401d3fbc2$b0ce3e90$126abbb0$@swisspug.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox