Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaq1T-0003VT-Aa for pgsql-performance@arkaria.postgresql.org; Sun, 14 Jan 2018 21:40:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaq1Q-0005us-O2 for pgsql-performance@arkaria.postgresql.org; Sun, 14 Jan 2018 21:40:56 +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.84_2) (envelope-from ) id 1eaq1Q-0005ui-DF for pgsql-performance@lists.postgresql.org; Sun, 14 Jan 2018 21:40:56 +0000 Received: from mail-it0-x243.google.com ([2607:f8b0:4001:c0b::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eaq1N-0007W4-1L for pgsql-performance@postgresql.org; Sun, 14 Jan 2018 21:40:55 +0000 Received: by mail-it0-x243.google.com with SMTP id c102so6709563itd.0 for ; Sun, 14 Jan 2018 13:40:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=t5LU9n+Oi+/1NApMKQo/GU90AV+BacSxNxP3VE1NDtY=; b=HhhhGqO1SUrNiCifswLKF2yK5nh9h6Q2tFczc2ETIDr7/DP5ax3GDtwXcVTq5ZG2Kh DXwEP+7wPvPqe+SbVerc8sGi7XPLlE5u1xkFOAkT3XTRd638R3Yf6JBMgBjBXr1q0rLe U3LHmL5iI6SCA0u6bK4R7lRUoNXmRKDST7okj55oc9fnQt5kOhofwbJByOtJT0AO4Ske APos+4x0ZUHneBzk0/abIqAn9BcKyhmXe4yPz70ahgymt2fN7CV5wEtCNqbq42tekl6U c/S51w8XGpbX/WWwOlciB7D43jO7A9qLPbLwdkdfFN7rm12BIkgXLYc9deKc1aQ/qPQS iXvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=t5LU9n+Oi+/1NApMKQo/GU90AV+BacSxNxP3VE1NDtY=; b=ZnvufWmS5ZdLdg8xmG2lOEmSZBDTDMIV6M/w0j6M+7T7NQzLwhwMxMSa0jEZ2yny3I MZjrFzbMKV93cAWPLOTa6J9TgnFUJYZ3B9cuC6muXAc7XlCgW+JymqOzs+71yEf23nIV pFsuaYvG437SNAw89glHuqP6L4UrkyucEpw3qm9TVvG5VfcL5MZp+9QS4/SFKC0lVESd 6DVbfnzVgiXop9N6RiDy1rIMA8XNIVlBwB+WS+274FjTsUHdLdutyKXF/E7PRHcKVbqr AfFF1g+/xEaYeFC8jPtniV+mwoUjHxgAeUVfEPgwCoBmxspqEXHFkA2BusW3HuI1c9bn 9+nQ== X-Gm-Message-State: AKwxytevL9Sd3bbYf43oY6g+5hHH10O6T7kKTxWXb3iklEitn/weinqs xs8lPU3KHemxug+F+tNVZq16Qw== X-Google-Smtp-Source: ACJfBou0uCDkHHJ1fwiHWtOvbHBEoy3tR1v8gKZ9uzMY56NVEfvezFG2Y4OH0IXBM9oM1TcdRFFvLA== X-Received: by 10.36.79.132 with SMTP id c126mr12596836itb.45.1515966051023; Sun, 14 Jan 2018 13:40:51 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id o67sm15733301ioe.10.2018.01.14.13.40.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 13:40:50 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 11A8B801102; Sun, 14 Jan 2018 15:40:48 -0600 (CST) Date: Sun, 14 Jan 2018 15:40:48 -0600 From: Justin Pryzby To: Neto pr Cc: postgres performance list Subject: Re: HDD vs SSD without explanation Message-ID: <20180114214048.GB32403@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Jan 14, 2018 at 12:44:00PM -0800, Neto pr wrote: > Dear all > > Someone help me analyze the two execution plans below (Explain ANALYZE > used), is the query 9 of TPC-H benchmark [1]. > > I'm using a server HP Intel Xeon 2.8GHz/4-core - Memory 8GB HDD SAS 320GB > 15 Krpm AND SSD Sansung EVO 500GB. > > I think maybe the execution plan is using more write operations, and so the > HDD SAS 15Krpm has been faster. The query plan is all garbled by mail , could you resend? Or post a link from https://explain.depesz.com/ To see if the query is causing many writes (due to dirty pages, sorts, etc), run with explain(analyze,buffers) But from what I could tell, your problems are here: -> Parallel Seq Scan on lineitem (cost=0.00..5861332.93 rows=100005093 width=41) (actual TIME=3.494..842667.110 rows=80004097 loops=3) vs -> Parallel Seq Scan on lineitem (cost=0.00..5861333.40 rows=100005140 width=41) (actual TIME=41.805..224438.909 rows=80004097 loops=3) -> Seq Scan on partsupp (cost=0.00..1052983.08 rows=31999708 width=22) (actual TIME=0.033..228828.149 rows=32000000 loops=3) vs -> Seq Scan on partsupp (cost=0.00..1052934.38 rows=31994838 width=22) (actual TIME=0.037..37865.003 rows=32000000 loops=3) Can you reproduce the speed difference using dd ? time sudo dd if=/dev/sdX of=/dev/null bs=1M count=32K skip=$((128*$RANDOM/32)) # set bs to optimal_io_size Or: bonnie++ -f -n0 What OS/kernel are you using? LVM? filesystem? I/O scheduler? partitions? readahead? blockdev --getra If you're running under linux, maybe you can just send the output of: for a in /sys/block/sdX/queue/*; do echo "$a `cat $a`"; done or: tail /sys/block/sdX/queue/{minimum_io_size,optimal_io_size,read_ahead_kb,scheduler,rotational,max_sectors_kb,logical_block_size,physical_block_size} Justin