Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eav9k-0000v1-E0 for pgsql-performance@arkaria.postgresql.org; Mon, 15 Jan 2018 03:09:52 +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 1eav9j-0004BO-8Y for pgsql-performance@arkaria.postgresql.org; Mon, 15 Jan 2018 03:09:51 +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 1eav9i-0004BE-RT for pgsql-performance@lists.postgresql.org; Mon, 15 Jan 2018 03:09:51 +0000 Received: from mail-it0-x233.google.com ([2607:f8b0:4001:c0b::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eav9e-0005qS-3Z for pgsql-performance@postgresql.org; Mon, 15 Jan 2018 03:09:50 +0000 Received: by mail-it0-x233.google.com with SMTP id c102so7176156itd.0 for ; Sun, 14 Jan 2018 19:09:45 -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:mime-version:content-disposition :in-reply-to:user-agent; bh=Ee1Ob/r6fP9hBIkr7N2XFkmFah3RIRD6iMPd/BWZKCM=; b=gq9YcLPfWGOBnqrQnyFnGxhyX9Sk4Z+oDnS/d+1tlrgLXMnaegtwnMKSiXLoCH8QuA wjJVOgpuIFEmvJAgU/Lprg/FhlDyvHGp2KdGBfGKqhBfTwba7soK69F5SxSSx1xaWCvo RvPfK4q7jDMxS2dqxEnaq9mSLOI41vVAoeNGtMmgCY5cz8QBLzqcqKCpIT9QBpQbp5dl 1v/EwMdgHeQCafmOW/7yTmjotOl7jwnOD/weSViNAR7X2gph/r04RvHfh0qgpkF3qEh7 uXt+z7fZR4bXnWLyWwerWpZv31r+1mu1IfEMVceDfI+FSjN46V62r8brnfwvENhoZTMw fTag== 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:mime-version :content-disposition:in-reply-to:user-agent; bh=Ee1Ob/r6fP9hBIkr7N2XFkmFah3RIRD6iMPd/BWZKCM=; b=IlK+eneM/wpCn0sFODkfe6IPm2ZJBVFe5ue5XajajaHyPLr3bxqQwjtaXIsSZ/FLVD APCfanGqtb8z8dyFko1MYzPZFFiW+kmAjkN4qHiwQzGoHxn3E1O1BMtIvg4o3r0p14an axG/RPManrLmWEf2j12Jh9p00bPMqyAIL3tzOR/8aCoEGDbYhitTPHsPvGL0hW2kUbFg zQnUDQBVBWRQFSy0LBsd/S/6T1Oxl8ak7OkSb47j6dIYD32PpLJLwX91Y5QMdIPLfMro kueaXZTd3qolD/B5uylG7LqK3pUcycrnBPh6MTlhbumpr0pV4aHZhHDJvpeEc9ghy2h8 ye9A== X-Gm-Message-State: AKwxytdU38sptxqoW2duUgTtUTPpGc8rRh18fmpAgc5iJEC1ptx/EmFB 6kAggErcRki+JHWwG0vDfkj0qw== X-Google-Smtp-Source: ACJfBot2CvXf2uTBTAKqp+VIWEdHeyZJ4bpJ7Ww9kik32ePQRwmfUB5uQDYTRNzzU+YYm9uwAxyWdA== X-Received: by 10.36.11.85 with SMTP id 82mr14410417itd.143.1515985782679; Sun, 14 Jan 2018 19:09:42 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id q3sm6117950ioh.67.2018.01.14.19.09.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 19:09:42 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 72455801102; Sun, 14 Jan 2018 21:09:41 -0600 (CST) Date: Sun, 14 Jan 2018 21:09:41 -0600 From: Justin Pryzby To: Neto pr Cc: postgres performance list Subject: Re: HDD vs SSD without explanation Message-ID: <20180115030941.GG32403@telsasoft.com> 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 06:25:40PM -0800, Neto pr wrote: > > The query plan is all garbled by mail , could you resend? Or post a link from > > https://explain.depesz.com/ On Sun, Jan 14, 2018 at 06:36:02PM -0800, Neto pr wrote: > I was not able to upload to the site, because I'm saving the execution > plan in the database, and when I retrieve it, it loses the line breaks, That's why it's an issue for me, too.. > > What OS/kernel are you using? LVM? filesystem? I/O scheduler? partitions? > > See below the Disk FileSystem -------------------------------- > root@hp2ml110deb:/# fdisk -l > Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors > > Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors > Units: sectors of 1 * 512 = 512 bytes > Sector size (logical/physical): 512 bytes / 512 bytes > I/O size (minimum/optimal): 512 bytes / 512 bytes > ---------------------------------------------------------------------------- What about sdb partitions/FS? On Sun, Jan 14, 2018 at 06:25:40PM -0800, Neto pr wrote: > The DBMS and tablespace of users is installed in /dev/sdb SSD. Is that also a temp_tablespace ? Or are your hashes spilling to HDD instead ? Group Key: nation.n_name, (date_part(_year_::text, (orders.o_orderdate)::timestamp without time zone)) Buffers: shared hit=3773802 read=7120852, temp read=3550293 written=3541542 Are your SSD being used for anything else ? What about these? > > 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} > > 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 Justin