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 1ffImR-0006DW-OA for pgsql-performance@arkaria.postgresql.org; Tue, 17 Jul 2018 05:44:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ffImP-0004B6-Oe for pgsql-performance@arkaria.postgresql.org; Tue, 17 Jul 2018 05:44:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffImO-0004Az-H4 for pgsql-performance@lists.postgresql.org; Tue, 17 Jul 2018 05:44:09 +0000 Received: from m12-14.163.com ([220.181.12.14]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ffImG-0004f8-TL for pgsql-performance@postgresql.org; Tue, 17 Jul 2018 05:44:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Subject:From:Message-ID:Date:MIME-Version; bh=8uyRU nWGmPmeLN0dtSDJ3m1utLweeB2b2kGNp/EWD0w=; b=AiuIKn/MjRWq0v65aXASm G0I2GyKqM83OkdjvvG1tGHuyU4INBZGSuPG8JK4zkRGMlDjpByhyjZhJai60Bs7H UTPrCUiqjrJMiF7pkfak15KORLHMENmQTReAXPb9EGB+bFcMDYYRANyh4Qhb9A10 HIQB3VbSDsYhxVo0m0F50E= Received: from [10.192.244.15] (unknown [106.38.85.238]) by smtp10 (Coremail) with SMTP id DsCowADX3+cYgk1bAxbLKA--.47120S2; Tue, 17 Jul 2018 13:43:53 +0800 (CST) Subject: Re: Why HDD performance is better than SSD in this case To: Benjamin Scherrey , Neto pr Cc: "pgsql-performa." References: From: winston cheung Message-ID: <96297cfc-eec0-b5ac-ef30-2fc360c52bd1@163.com> Date: Tue, 17 Jul 2018 13:43:52 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------3A844C4607E53275F9074E8E" Content-Language: en-US X-CM-TRANSID: DsCowADX3+cYgk1bAxbLKA--.47120S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF47WrykXrWDJr15XFyDGFg_yoW8WFyfpa yfKryfGFn3tFy3JrykAw18XrW0qrWxCa17KrsrJr10q3s8Cr129F4j9F1rCrZ5Cryjywn7 XrW7uFWF9wn8uFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jq6wZUUUUU= X-Originating-IP: [106.38.85.238] X-CM-SenderInfo: pzlq23prqbuxphxqwqqrwthudrp/1tbiJRuGmlUML6pD4AAAsd List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------3A844C4607E53275F9074E8E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Can you show the configuration of postgresql.conf? Query configuration method: Select name, setting from pg_settings where name ~ 'buffers|cpu|^enable'; On 2018年07月17日 13:17, Benjamin Scherrey wrote: > What's the on disk cache size for each drive? The better HDD > performance problem won't be sustained with large amounts of data and > several different queries. > >   - - Ben Scherrey > > On Tue, Jul 17, 2018, 12:01 PM Neto pr > wrote: > > Dear, > Some of you can help me understand this. > > This query plan is executed in the query below (query 9 of TPC-H > Benchmark, with scale 40, database with approximately 40 gb). > > The experiment consisted of running the query on a HDD (Raid zero). > Then the same query is executed on an SSD (Raid Zero). > > Why did the HDD (7200 rpm)  perform better? > HDD - TIME 9 MINUTES > SSD - TIME 15 MINUTES > > As far as I know, the SSD has a reading that is 300 times faster > than SSD. > > --- Execution  Plans--- > ssd 40g > https://explain.depesz.com/s/rHkh > > hdd 40g > https://explain.depesz.com/s/l4sq > > Query ------------------------------------ > > select >     nation, >     o_year, >     sum(amount) as sum_profit > from >     ( >         select >             n_name as nation, >             extract(year from o_orderdate) as o_year, >             l_extendedprice * (1 - l_discount) - ps_supplycost * > l_quantity as amount >         from >             part, >             supplier, >             lineitem, >             partsupp, >             orders, >             nation >         where >             s_suppkey = l_suppkey >             and ps_suppkey = l_suppkey >             and ps_partkey = l_partkey >             and p_partkey = l_partkey >             and o_orderkey = l_orderkey >             and s_nationkey = n_nationkey >             and p_name like '%orchid%' >     ) as profit > group by >     nation, >     o_year > order by >     nation, >     o_year desc > -- 张文升 winston
PostgreSQL DBA
--------------3A844C4607E53275F9074E8E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Can you show the configuration of postgresql.conf?
Query configuration method:
Select name, setting from pg_settings where name ~ 'buffers|cpu|^enable';


On 2018年07月17日 13:17, Benjamin Scherrey wrote:
What's the on disk cache size for each drive? The better HDD performance problem won't be sustained with large amounts of data and several different queries. 

  - - Ben Scherrey 

On Tue, Jul 17, 2018, 12:01 PM Neto pr <netopr9@gmail.com> wrote:
Dear,
Some of you can help me understand this.

This query plan is executed in the query below (query 9 of TPC-H
Benchmark, with scale 40, database with approximately 40 gb).

The experiment consisted of running the query on a HDD (Raid zero).
Then the same query is executed on an SSD (Raid Zero).

Why did the HDD (7200 rpm)  perform better?
HDD - TIME 9 MINUTES
SSD - TIME 15 MINUTES

As far as I know, the SSD has a reading that is 300 times faster than SSD.

--- Execution  Plans---
ssd 40g
https://explain.depesz.com/s/rHkh

hdd 40g
https://explain.depesz.com/s/l4sq

Query ------------------------------------

select
    nation,
    o_year,
    sum(amount) as sum_profit
from
    (
        select
            n_name as nation,
            extract(year from o_orderdate) as o_year,
            l_extendedprice * (1 - l_discount) - ps_supplycost *
l_quantity as amount
        from
            part,
            supplier,
            lineitem,
            partsupp,
            orders,
            nation
        where
            s_suppkey = l_suppkey
            and ps_suppkey = l_suppkey
            and ps_partkey = l_partkey
            and p_partkey = l_partkey
            and o_orderkey = l_orderkey
            and s_nationkey = n_nationkey
            and p_name like '%orchid%'
    ) as profit
group by
    nation,
    o_year
order by
    nation,
    o_year desc


-- 
<b>张文升</b> winston<br />
PostgreSQL DBA<br />
--------------3A844C4607E53275F9074E8E--