From: Michael Lewis <mlewis@entrata.com>
To: Peter Grman <peter.grman@gmail.com>
Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: Bad Estimate for multi tenant database queries
Date: Tue, 3 Sep 2019 12:39:34 -0600
Message-ID: <CAHOFxGoUNnvKAdnwjMmesLu+RkoMBtkDn+LiPrfewSYP40KCSw@mail.gmail.com> (raw)
In-Reply-To: <CACF7Wx36G0YBM7xjDhZkG1d_B8jgD6Q=WFCrk7o=exNiniom1g@mail.gmail.com>
References: <CACF7Wx36G0YBM7xjDhZkG1d_B8jgD6Q=WFCrk7o=exNiniom1g@mail.gmail.com>
>
> CREATE STATISTICS MT_ReservationDepartureUtc (ndistinct) on "AccountCode",
> "DepartureUtc" from "Reservation"."Reservation";
> CREATE STATISTICS MT_ReservationArrivalUtc (ndistinct) on "AccountCode",
> "ArrivalUtc" from "Reservation"."Reservation";
> CREATE STATISTICS MT_ReservationNoShowFeeId (ndistinct) on "AccountCode",
> "NoShowFeeId" from "Reservation"."Reservation";
> CREATE STATISTICS MT_ReservationTimeSliceDefinitionId (ndistinct) on
> "AccountCode", "TimeSliceDefinitionId" from "Reservation"."Reservation";
>
> but that didn't help either
>
Did you try with 'dependencies' for the statistics_kind or only ndistinct?
What was default_statistics_target set to at the time you created the
extended statistics? I am not sure if that value is used, but I would
assume so.
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: mlewis@entrata.com, peter.grman@gmail.com
Subject: Re: Bad Estimate for multi tenant database queries
In-Reply-To: <CAHOFxGoUNnvKAdnwjMmesLu+RkoMBtkDn+LiPrfewSYP40KCSw@mail.gmail.com>
References: <CACF7Wx36G0YBM7xjDhZkG1d_B8jgD6Q=WFCrk7o=exNiniom1g@mail.gmail.com> <CAHOFxGoUNnvKAdnwjMmesLu+RkoMBtkDn+LiPrfewSYP40KCSw@mail.gmail.com>
* 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