Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jjGqX-0007YX-KD for pgsql-performance@arkaria.postgresql.org; Thu, 11 Jun 2020 06:37:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jjGqV-0002vO-3Z for pgsql-performance@arkaria.postgresql.org; Thu, 11 Jun 2020 06:37:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jjFPd-0008IG-W5 for pgsql-performance@lists.postgresql.org; Thu, 11 Jun 2020 05:06:02 +0000 Received: from 0190701781.0.fullrate.ninja ([90.185.254.91] helo=mail.tala.dk) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jjFPV-000773-JX for pgsql-performance@postgresql.org; Thu, 11 Jun 2020 05:05:59 +0000 Received: from tala.dk (localhost [IPv6:::1]) by mail.tala.dk (Postfix) with ESMTP id ECAB460015986; Thu, 11 Jun 2020 07:05:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.tala.dk ECAB460015986 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tala.dk; s=mail; t=1591851951; bh=3SyMi3TQ5wSVBeV09s68DWM6ky3sNEYNnWeBKVFgQqM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Z+zXwjeZdcAHnNlQnE5wD1kCvYQBEnvz9BT2MFdJ8Zk6rmU9qPxq70I02DqLd38eV 0ub94+kia6ylKeENvmePIl+WGlF9bCSnJjUmr8vwVfAoTefe6KFsbd4CUH8tr+ssYl tkOvSJ4NqywU/+Lm33RmjYYoHQjDp6VYGVUEaCl4= MIME-Version: 1.0 Date: Thu, 11 Jun 2020 07:05:50 +0200 From: Mikkel Lauritsen To: David Rowley Cc: pgsql-performance Subject: Re: Windows slowness? In-Reply-To: References: User-Agent: Roundcube Webmail/1.4.4 Message-ID: <9c05b2302f277afd0ced7e74a96ca5a7@tala.dk> X-Sender: renard@tala.dk Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi David, Many thanks for your response - you wrote: On 2020-06-10 23:08, David Rowley wrote: > On Thu, 11 Jun 2020 at 07:41, Mikkel Lauritsen wrote: >> I have a query that runs much slower in Postgres on Windows than on >> Linux > >> Using explain analyze on the database running on Windows I get >> >> -> Index Scan using event_pkey on event t1 (cost=0.56..0.95 rows=1 >> width=295) (actual time=0.075..0.075 rows=0 loops=229227) > >> If I copy the database to my laptop running Linux (Postgres 12 on >> Fedora >> 32, i7-9750H, 16 GB ram) I get the exact same execution plan. Explain >> analyze says >> >> -> Index Scan using event_pkey on event t1 (cost=0.56..0.95 rows=1 >> width=295) (actual time=0.008..0.008 rows=0 loops=229227) --- snip --- > Can you confirm what: SELECT pg_relation_size('event_pkey'), > pg_relation_size('event'); says on each 1011384320 and 2753077248, respectively. --- snip --- > It would be good to see: > > SET track_io_timing = on; > EXPLAIN (ANALYZE, BUFFERS) I wasn't aware of that tracing option - thanks! For this particular plan entry the output is Buffers: shared hit=896304 read=257234 I/O Timings: read=11426.745 Some rows have been added to the table since my initial mail, so the numbers may be slightly off. As another reply has suggested I need to verify that somebody hasn't accidentally misconfigured an antivirus client to scan the database files. If that turns out to be the case I guess it's embarrassment of the year for me :-/ Best regards, Mikkel Lauritsen