Re: Cost Model

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: neto brpr <netobrpr(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Cost Model
Date: 2017-12-20 18:37:40
Message-ID: CAKFQuwbQNJxgd2V9726O5VRwt3nEPSBkOWABO+5Re5kcn=U-yg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 20, 2017 at 11:26 AM, neto brpr <netobrpr(at)gmail(dot)com> wrote:

> Dear David
> I have read documentation that you send, but it has only sequential page
> cost and random page cost parameters. What I need, would be a model of
> custo for Differentiate Read/Write (sequential and random), because in SSDs
> the reads and writes have different costs. If you or someone knows a patch
> or other solution, that allows you to configure individual parameters to:
>
> - Sequential reading page cost
> - cost of the random reading page
> - sequential recording page cost
> - Random recording page cost
>
>
​Please don't top-post.

OK...reading more closely I don't see how "recording/writing" costs are
important in decision making. Either you have to write something, or you
don't.​ If you do you updates pages in a buffer and generate WAL and then
the system puts the data onto disk where they belong - the database itself
doesn't care about that part and knowing how fast or slow it might happen
would impact it behavior. So PostgreSQL provides read settings to be tuned
so it can decide between index and table scans on the table in question.

The system doesn't understand SSD or HDD but does understand tablespaces
and I believe that many of these settings are able to be configured on a
per-tablespace (or table?) basis.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-12-20 18:39:49 Re: Basebackups reported as idle
Previous Message Alvaro Herrera 2017-12-20 18:35:23 Re: Cost Model