Re: Cost Model - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Cost Model
Date
Msg-id CAKFQuwbQNJxgd2V9726O5VRwt3nEPSBkOWABO+5Re5kcn=U-yg@mail.gmail.com
Whole thread Raw
In response to Re: Cost Model  (neto brpr <netobrpr@gmail.com>)
Responses Re: Cost Model
List pgsql-hackers
On Wed, Dec 20, 2017 at 11:26 AM, neto brpr <netobrpr@gmail.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.

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Cost Model
Next
From: Alvaro Herrera
Date:
Subject: Re: Basebackups reported as idle