2018-01-14 13:40 GMT-08:00 Justin Pryzby <pryzby@xxxxxxxxxxxxx>: > 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 OS = Debian 8 64bits - 3.16.0-4 See below the Disk FileSystem -------------------------------- root@hp2ml110deb:/# fdisk -l Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 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 Disklabel type: gpt Disk identifier: 26F5EB21-30DB-44E4-B9E2-E8105846B6C4 Device Start End Sectors Size Type /dev/sda1 2048 1050623 1048576 512M EFI System /dev/sda2 1050624 1937274879 1936224256 923.3G Linux filesystem /dev/sda3 1937274880 1953523711 16248832 7.8G Linux swap 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 ---------------------------------------------------------------------------- The DBMS and tablespace of users is installed in /dev/sdb SSD. > 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