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 1ffJ9Y-0007dV-RH for pgsql-performance@arkaria.postgresql.org; Tue, 17 Jul 2018 06:08:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ffJ9U-0000zr-9J for pgsql-performance@arkaria.postgresql.org; Tue, 17 Jul 2018 06:08:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffJ9U-0000zk-1m for pgsql-performance@lists.postgresql.org; Tue, 17 Jul 2018 06:08:00 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([202.78.240.226]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffJ9N-0006LC-Q0 for pgsql-performance@postgresql.org; Tue, 17 Jul 2018 06:07:58 +0000 Authentication-Results: auth=pass smtp.auth=mark.kirkwood@catalyst.net.nz smtp.mailfrom=mark.kirkwood@catalyst.net.nz Received: from [IPv6:2406:e001:cf9:1:9488:f51d:bde1:c52c] (unknown [IPv6:2406:e001:cf9:1:9488:f51d:bde1:c52c]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id 5F91280A32; Tue, 17 Jul 2018 18:07:44 +1200 (NZST) Subject: Re: Why HDD performance is better than SSD in this case To: Neto pr , postgres performance list References: From: Mark Kirkwood Message-ID: <4fc347b1-a7f9-c0cf-58e6-99f0c37028b2@catalyst.net.nz> Date: Tue, 17 Jul 2018 18:07:44 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Can you post make and model of the SSD concerned? In general the cheaper consumer grade ones cannot do sustained read/writes at anything like their quoted max values. regards Mark On 17/07/18 17:00, 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 >