Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bzX6b-0008RW-7D for pgsql-performance@arkaria.postgresql.org; Wed, 26 Oct 2016 22:55:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bzX6Z-0003SG-J2 for pgsql-performance@arkaria.postgresql.org; Wed, 26 Oct 2016 22:55:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bzX6Y-0003S7-VJ for pgsql-performance@postgresql.org; Wed, 26 Oct 2016 22:55:31 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bzX6V-0001uH-Un for pgsql-performance@postgresql.org; Wed, 26 Oct 2016 22:55:29 +0000 Received: by mail-wm0-x230.google.com with SMTP id e69so62424199wmg.0 for ; Wed, 26 Oct 2016 15:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=tMzizrZdd68Qu2v11ZmSpTFHM4sf1Hzp0IUB0OTh9S4=; b=d9FZVMdbUx7/42yU+ZgJr6GxR++YD684pIOZ8R4atRlHbaPo+mVz8PABxUMMFq/b4d xp0LgamtyT+sJzda/KNThllhhpNv+5SR6ewyHCftMQYnn2MGrLpDGh8khMnTgID7CPZc 950M+0gHi1ohisjiZrwLRsjVdUfrzkB4MpDVrI9n8+1vSdplqzYGfJmNMI19kXdWDkEv NQnVOLMb4so9cA5c5jSanYryay5VoXL6HuDlRvzThUxWWuXwANMNTNqI4d209RRv/oJx 0+q5pvHBYTBxPOV8zgUA23abI1wNwTi3i1ATW6LrZ3JiKCAFJ7EISE0unGQxwGBSZMvL fD7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=tMzizrZdd68Qu2v11ZmSpTFHM4sf1Hzp0IUB0OTh9S4=; b=lkcErClTKokr71gJ7v2PRFS5txzRuX17ootyxZppMO/azzWUSyoAl/jl0PvkyYXXsc XvUtIsuMIL4j5U7IMchVGhJY96/j7YgFc+0qWPWfTlhL4Np4nsLW5ngTffhrLtrxJ81A HIdNBt1Jcq/W88MiGUFM3Kzq0EwVRUhibPOtCZmDpnDOw4jSZPUxOPCuy+usPi5P9GlT jjcByjDaiAJhj0HMlF7kUYHsmxNlHDwZMEz6DqGrR9Gs1p2u9WmQm6lKLtGTEf+Weltf Wv3UizBM9UFrAc6ABjma3cg4hZY1AgnV0MOWH3PoUat4SoboIwJIkNpV9bxwhzvnw4aD 1fbg== X-Gm-Message-State: ABUngvc9HpTjKSJwNhn9xfxiXkCcqvTvALi9BGoG3SWAk1Qkw/sfyzO4Kd/AEjtC9BDhHjtVJaX9bbVMjv5d6Fg6b9Ka/VCSGwr0wfOpw9zzdeaSveg/WvV4tAiisjZJWholFuCJ8y1MWaajmBbTh6hHSHpW2CGWHfmfLwAWzKAA66DOlZWBh2y+cEwctg9YaYjDXHth2pnrIBsTeQ== X-Received: by 10.194.55.234 with SMTP id v10mr4020210wjp.10.1477522525684; Wed, 26 Oct 2016 15:55:25 -0700 (PDT) Received: from [10.137.2.17] (ip-89-177-44-58.net.upcbroadband.cz. [89.177.44.58]) by smtp.gmail.com with ESMTPSA id 72sm5508731wme.15.2016.10.26.15.55.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Oct 2016 15:55:24 -0700 (PDT) Subject: Re: query slowdown after 9.0 -> 9.4 migration To: pgsql-performance@postgresql.org References: From: Tomas Vondra Message-ID: Date: Thu, 27 Oct 2016 00:55:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Thunderbird/46.0a2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 10/26/2016 03:48 PM, Filip RembiaƂkowski wrote: > Hi. > > Query run time degraded after migration from Pg 9.0 + postgis 1.5 to Pg > 9.4 + postgis 2.2. > > 1 ms versus 7 ms. > > Same query, same data, same schema, similar hardware. Data is small and > fits in cache. > > EXPLAIN shows heap scan cost increase. What can be the reason for > 40-fold increase in page scans needed to run Bitmap Heap Scan with > Filter and Recheck? > On 9.0 the the scan accesses only 8 buffers: Buffers: shared hit=8 while on 9.4 it has to inspect 316 of them: Buffers: shared hit=316 Perhaps the table is organized / sorted differently, or something like that. How did you do the upgrade? ragards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance