Re: Question on disk contention
От | Ron |
---|---|
Тема | Re: Question on disk contention |
Дата | |
Msg-id | 88441bd2-0118-67b7-60b4-a0afa59a326e@gmail.com обсуждение исходный текст |
Ответ на | Re: Question on disk contention (Melvin Davidson <melvin6925@gmail.com>) |
Ответы |
Re: Question on disk contention
|
Список | pgsql-general |
On 05/31/2018 08:52 AM, Melvin Davidson wrote:
Why isn't the OS caching the disk blocks, and why isn't Postgres using the cached data?
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 getthat information from the disk, which causes the disk head to "seek" to the position of the first eligible row andcontinues positioning to other eligible rows. Now the job is not exclusive, so the system temporarily switches to theother 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 takesa 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 longit takes. Then submit the same query from 5 separate connections simultaneously and see how long that takes.
Why isn't the OS caching the disk blocks, and why isn't Postgres using the cached data?
--
Angular momentum makes the world go 'round.
Angular momentum makes the world go 'round.
В списке pgsql-general по дате отправления: