Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2dua-0003m8-Gk for pgsql-general@arkaria.postgresql.org; Wed, 19 Sep 2018 14:57:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g2duY-0007HI-Bb for pgsql-general@arkaria.postgresql.org; Wed, 19 Sep 2018 14:57:02 +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.89) (envelope-from ) id 1g2duY-0007HA-3A for pgsql-general@lists.postgresql.org; Wed, 19 Sep 2018 14:57:02 +0000 Received: from mail.i-mark.de ([188.138.104.222]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2duU-0000fT-SF for pgsql-general@lists.postgresql.org; Wed, 19 Sep 2018 14:57:01 +0000 Received: from [192.168.178.20] (unknown [185.38.49.16]) by mail.i-mark.de (Postfix) with ESMTPSA id B27771580928 for ; Wed, 19 Sep 2018 16:56:53 +0200 (CEST) Authentication-Results: loft7616.startdedicated.de; spf=pass (sender IP is 185.38.49.16) smtp.mailfrom=andreas@a-kretschmer.de smtp.helo=[192.168.178.20] Received-SPF: pass (loft7616.startdedicated.de: connection is authenticated) Subject: Re: *Regarding brin_index on required column of the table To: pgsql-general@lists.postgresql.org References: From: Andreas Kretschmer Message-ID: <1962c603-099a-e947-e376-548ae4b68f19@a-kretschmer.de> Date: Wed, 19 Sep 2018 16:56:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Am 19.09.2018 um 16:43 schrieb Durgamahesh Manne: > > > On Wed, Sep 19, 2018 at 8:02 PM Andreas Kretschmer > > wrote: > > > > Am 19.09.2018 um 15:51 schrieb Durgamahesh Manne: > > I have created BRIN index on few columns of the table without any > > issues. But i am unable to create BRIN index on one column of the > > table as i got error listed below > > > > > > [local]:6263 postgres@huawei=# CREATE INDEX brin_idx on huawei > using > > brin ("dFetch"); > > ERROR:  data type boolean has no default operator class for access > > method "brin" > > HINT:  You must specify an operator class for the index or define a > > default operator class for the data type. > > honestly, a BRIN-Index on a bool-column doesn't make much sense. > What do > you want to achive? Maybe a partial index with a where-condition > on that > column makes much more sense. > > > Regards, Andreas > > -- > 2ndQuadrant - The PostgreSQL Support Company. > www.2ndQuadrant.com > > > > Hi > > > I want to execute distinct query at less possible time > > for that reason ,Even i have already tried with BTREE indexes & HASH > indexes on required columns .distinct query execution time was not reduced > > select  distinct sub_head."vchSubmittersCode" ,rec."vchFileName" , > rec."vchCusipFundIDSubFundID" , rec."vchFundUnitPrice"  ,  > sub_head."vchValuationDate" ,rec."vchAdvisorLabel" from  "table1" rec > join  "table2" sub_head on > rec."vchSubmittersCode"=sub_head."vchSubmittersCode" where > rec."bFetch"=false and sub_head."bFetch"=false ; > > Query taken around 7 minutes time to execute with BTREE indexes & HASH > indexes on required columns > try an index like create index idx_t1 on table1 ("vchSubmittersCode") where "bFetch"=false and create index idx_t2 on table2 ("vchSubmittersCode") where "bFetch"=false and check if the plan changed and the indexes are in use. You can use create index concurrently to prevent lockings. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com