From: Andreas Kretschmer <andreas@a-kretschmer.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: *Regarding brin_index on required column of the table
Date: Wed, 19 Sep 2018 16:56:56 +0200
Message-ID: <1962c603-099a-e947-e376-548ae4b68f19@a-kretschmer.de> (raw)
In-Reply-To: <CAJCZkoLjQJPeK4RhaJo1L0J6SS9otQ=CNf=Kck3NK4qCcJmNZQ@mail.gmail.com>
References: <CAJCZko++xfddUpwC34FwPRvoK_9mEBecYY2eKUyvHnqNanND5w@mail.gmail.com>
<bb757960-8a9a-910b-c734-3e67171f8815@a-kretschmer.de>
<CAJCZkoLjQJPeK4RhaJo1L0J6SS9otQ=CNf=Kck3NK4qCcJmNZQ@mail.gmail.com>
Am 19.09.2018 um 16:43 schrieb Durgamahesh Manne:
>
>
> On Wed, Sep 19, 2018 at 8:02 PM Andreas Kretschmer
> <andreas@a-kretschmer.de <mailto:andreas@a-kretschmer.de>> 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 <http://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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: andreas@a-kretschmer.de
Subject: Re: *Regarding brin_index on required column of the table
In-Reply-To: <1962c603-099a-e947-e376-548ae4b68f19@a-kretschmer.de>
References: <CAJCZko++xfddUpwC34FwPRvoK_9mEBecYY2eKUyvHnqNanND5w@mail.gmail.com> <bb757960-8a9a-910b-c734-3e67171f8815@a-kretschmer.de> <CAJCZkoLjQJPeK4RhaJo1L0J6SS9otQ=CNf=Kck3NK4qCcJmNZQ@mail.gmail.com> <1962c603-099a-e947-e376-548ae4b68f19@a-kretschmer.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox