Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckrbw-0001DT-AA for pgsql-performance@arkaria.postgresql.org; Mon, 06 Mar 2017 12:19:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ckrbv-00024G-OX for pgsql-performance@arkaria.postgresql.org; Mon, 06 Mar 2017 12:19:31 +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 1ckraA-0007La-Fx for pgsql-performance@postgresql.org; Mon, 06 Mar 2017 12:17:42 +0000 Received: from mxgate02.infotech-enterprises.com ([110.76.160.160] helo=mxgate02.cyient.com) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1ckra0-0001uI-CE for pgsql-performance@postgresql.org; Mon, 06 Mar 2017 12:17:40 +0000 X-IronPort-AV: E=Sophos;i="5.35,253,1483986600"; d="scan'208";a="48830607" Received: from unknown (HELO INFHYDEX10AHT2.corp.infotech-enterprises.com) ([172.17.0.115]) by mxgate02.cyient.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Mar 2017 17:39:35 +0530 Received: from CYINMBX5.CORP.CYIENT.COM (172.17.4.165) by INFHYDEX10AHT2.corp.infotech-enterprises.com (172.17.0.115) with Microsoft SMTP Server (TLS) id 14.3.158.1; Mon, 6 Mar 2017 17:47:27 +0530 Received: from CYINMBX4.CORP.CYIENT.COM (172.17.4.164) by CYINMBX5.CORP.CYIENT.COM (172.17.4.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.27; Mon, 6 Mar 2017 17:47:22 +0530 Received: from CYINMBX4.CORP.CYIENT.COM ([fe80::e40c:d4fe:9e0c:f465]) by CYINMBX4.CORP.CYIENT.COM ([fe80::e40c:d4fe:9e0c:f465%19]) with mapi id 15.01.0544.027; Mon, 6 Mar 2017 17:47:22 +0530 From: Dinesh Chandra 12108 To: Justin Pryzby CC: Nur Agus , Jeff Janes , "pgsql-performance@postgresql.org" Subject: Re: Performance issue in PostgreSQL server... Thread-Topic: [PERFORM] Performance issue in PostgreSQL server... Thread-Index: AdKUCRR1R30VhxuMT2utF4ZoBbTRiP//w5kA//+eX3CABJJiAIAAEQQA//8xNEA= Date: Mon, 6 Mar 2017 12:17:22 +0000 Message-ID: References: <0796d1d53d3e4aa692cfdc329f86b399@cyient.com> <20170306052402.GC16088@telsasoft.com> In-Reply-To: <20170306052402.GC16088@telsasoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.17.4.81] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Pg-Spam-Score: -3.5 (---) 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 Dear Justin, Below is the output of Query SELECT * FROM pg_stats WHERE tablename=3D'poin= t' AND attname=3D'domain_class_id' ; schemaname | tablename | attname | inherited | null_frac | avg_widt= h | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | = correlation "evidence"|"point"|"domain_class_id"|f|0|8|10|"{7,9,2,11,43,3,1,10,4,17}"|"= {0.9322,0.0451333,0.0145,0.00393333,0.00183333,0.00146667,0.0005,0.0003,6.6= 6667e-05,6.66667e-05}"|""|0.889078 Regards, Dinesh Chandra |Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida. -----Original Message----- From: Justin Pryzby [mailto:pryzby@telsasoft.com] Sent: 06 March, 2017 10:54 AM To: Dinesh Chandra 12108 Cc: Nur Agus ; Jeff Janes ; = pgsql-performance@postgresql.org Subject: Re: [PERFORM] Performance issue in PostgreSQL server... On Sun, Mar 05, 2017 at 08:23:08PM -0800, Jeff Janes wrote: > On Fri, Mar 3, 2017 at 4:44 AM, Dinesh Chandra 12108 wrote: > > The below is the output for psql=3D> EXPLAIN ANALYZE SELECT DISTINCT > > feature_id FROM evidence.point p INNER JOIN > > evidence.observation_evidence oe ON p.feature_id =3D oe.evd_feature_id > > WHERE p.domain_class_id IN (11) AND (p.modification_time > > > '2015-05-10 00:06:56.056 IST' OR oe.modification_time > '2015-05-10 > > 00:06:56.056 IST') ORDER BY feature_id > ... > > > -> Index Scan using point_domain_class_id_index o= n point p (cost=3D0.00..1483472.70 rows=3D1454751 width=3D16) (actual time= =3D27.265..142101.1 59 rows=3D1607491 loops=3D1) > > Index Cond: (domain_class_id =3D 11) > > Why wouldn't this be using a bitmap scan rather than a regular index scan? > It seems like it should prefer the bitmap scan, unless the table is > well clustered on domain_class_id. In which case, why isn't it just fast= er? Could you send: SELECT * FROM pg_stats WHERE tablename=3D'point' AND attname=3D'domain_clas= s_id' ; .. or if that's too verbose or you don't want to share the histogram or MCV list: SELECT correlation FROM pg_stats WHERE tablename=3D'point' AND attname=3D'd= omain_class_id' ; Justin ________________________________ DISCLAIMER: This email message is for the sole use of the intended recipient(s) and may= contain confidential and privileged information. Any unauthorized review, = use, disclosure or distribution is prohibited. If you are not the intended = recipient, please contact the sender by reply email and destroy all copies = of the original message. Check all attachments for viruses before opening t= hem. All views or opinions presented in this e-mail are those of the author= and may not reflect the opinion of Cyient or those of our affiliates. --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance