From: Josh Berkus <josh@agliodbs.com>
To: Merlin Moncure <mmoncure@gmail.com>
To: Patrick Krecker <patrick@judicata.com>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Row estimates off by two orders of magnitude with hstore
Date: Wed, 10 Jun 2015 12:40:11 -0700
Message-ID: <5578929B.6060400@agliodbs.com> (raw)
In-Reply-To: <WM!5e17bf4dc446f68652e121654dfd43140f3020c6dd8af9855889199338a37a02c79871639e102552c7a850f9fd4a06e5!@asav-2.01.com>
References: <CAK2mJFO85L3LMjLHZjeMYQdYEd=oJN0Dg0OYGiN9-Xu=2OYowg@mail.gmail.com>
<CAHyXU0z_R2PztdP1pGHGv09K3Mz+Dry-kMH+J0=qmGaH-JRrwA@mail.gmail.com>
<WM!5e17bf4dc446f68652e121654dfd43140f3020c6dd8af9855889199338a37a02c79871639e102552c7a850f9fd4a06e5!@asav-2.01.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
On 06/10/2015 11:32 AM, Merlin Moncure wrote:
> This is a fundamental issue with using 'database in a box' datatypes
> like hstore and jsonb. They are opaque to the statistics gathering
> system and so are unable to give reasonable estimates beyond broad
> assumptions. Speaking generally, the workarounds are too:
>
> *) disable particular plan choices for this query
> (materialize/nestloop are common culprits)
>
> *) create btree indexes around specific extraction clauses
>
> *) refactor some of the query into set returning function with a
> custom ROWS clause
>
> *) try alternate indexing strategy such as jsonb/jsquery
>
> *) move out of hstore and into more standard relational strucure
You forgot:
*) Fund a PostgreSQL developer to add selectivity estimation and stats
to hstore.
--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: josh@agliodbs.com, mmoncure@gmail.com, patrick@judicata.com
Subject: Re: Row estimates off by two orders of magnitude with hstore
In-Reply-To: <5578929B.6060400@agliodbs.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