Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZMzWe-0005Jk-4a for pgsql-admin@arkaria.postgresql.org; Wed, 05 Aug 2015 14:18:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZMzWd-00044l-M3 for pgsql-admin@arkaria.postgresql.org; Wed, 05 Aug 2015 14:18:35 +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) (envelope-from ) id 1ZMzUy-0007lg-Nx for pgsql-admin@postgresql.org; Wed, 05 Aug 2015 14:16:52 +0000 Received: from mailout.easymail.ca ([64.68.201.169]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZMzUu-0006QZ-RY for pgsql-admin@postgresql.org; Wed, 05 Aug 2015 14:16:51 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 66DC0E244; Wed, 5 Aug 2015 10:16:45 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at mailout.easymail.ca X-Spam-Flag: NO X-Spam-Score: -3.838 X-Spam-Level: X-Spam-Status: No, score=-3.838 required=5 tests=[ALL_TRUSTED=-1.8, AWL=-0.131, BAYES_00=-2.599, DNS_FROM_AHBL_RHSBL=0.692] Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (easymail-mailout.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qHmXev9HoRP2; Wed, 5 Aug 2015 10:16:43 -0400 (EDT) Received: from [192.168.2.16] (unknown [8.39.228.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id DE7C4E243; Wed, 5 Aug 2015 10:16:42 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: Query runs on 9.2, but not on 9.4 From: Scott Ribe In-Reply-To: Date: Wed, 5 Aug 2015 08:16:40 -0600 Cc: "pgsql-admin@postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <26BEAB1A-1F90-4850-AE95-99E9CA1CDD37@elevated-dev.com> References: To: John Scalia X-Mailer: Apple Mail (2.2098) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On Aug 5, 2015, at 7:56 AM, John Scalia wrote: >=20 > SELECT > c.relname, > pg_size_pretty(count(*) * 8192) as buffered, > round(100.0 * count(*) / > (SELECT setting FROM pg_settings > WHERE name=3D'shared_buffers')::integer,1) > AS buffers_percent, > round(100.0 * count(*) * 8192 / > pg_relation_size(c.oid),1) > AS percent_of_relation > FROM pg_class c > INNER JOIN pg_buffercache b > ON b.relfilenode =3D c.relfilenode > INNER JOIN pg_database d > ON (b.reldatabase =3D d.oid AND d.datname =3D current_database()) > GROUP BY c.oid,c.relname > ORDER BY 3 DESC > LIMIT 25; So, the first thing I would do is change: > round(100.0 * count(*) / > (SELECT setting FROM pg_settings > WHERE name=3D'shared_buffers')::integer,1) to: > (SELECT setting FROM pg_settings > WHERE name=3D'shared_buffers')::integer,1) and change: > round(100.0 * count(*) * 8192 / > pg_relation_size(c.oid),1) to: > pg_relation_size(c.oid),1) Then look for 0s in those output columns. I'll bet that the 9.4 vs 9.2 diff= erence is simply a value of 0 for one of those, not some exotic thing about= the query plan. If I'm right about that, then you can start hunting down a= specific explanation. --=20 Scott Ribe scott_ribe@elevated-dev.com http://www.elevated-dev.com/ https://www.linkedin.com/in/scottribe/ (303) 722-0567 voice --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin