From:
PostgreSQL - Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
To:
Robert Haas <robertmhaas(at)gmail(dot)com>
Cc:
Nathan Boley <npboley(at)gmail(dot)com>,
pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>,
Boszormenyi Zoltan <zb(at)cybertec(dot)at>
Subject:
Re: WIP: cross column correlation ...
Date:
2011-02-23 14:56:59
Message-ID:
B987D673-4905-4154-B2D5-C1624368E7E3@cybertec.at (view raw or flat )
Thread:
2011-02-22 19:48:47 from PostgreSQL - Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
2011-02-23 01:58:00 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-23 02:43:59 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-02-23 02:56:37 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-23 03:04:12 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-02-23 08:15:39 from PostgreSQL - Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
2011-02-23 14:48:13 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-23 14:54:11 from PostgreSQL - Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
2011-02-23 22:37:39 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-02-23 05:50:50 from Nathan Boley <npboley(at)gmail(dot)com>
2011-02-23 14:46:34 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-23 14:56:59 from PostgreSQL - Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
2011-02-23 08:02:28 from PostgreSQL - Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
2011-02-23 15:10:07 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-23 22:40:00 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-02-24 20:42:39 from Josh Berkus <josh(at)agliodbs(dot)com>
2011-02-25 06:33:59 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-02-25 13:18:40 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-25 16:45:43 from Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
2011-02-25 17:50:51 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-25 22:35:45 from Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
2011-02-25 17:03:58 from Rod Taylor <rod(dot)taylor(at)gmail(dot)com>
2011-02-25 19:26:10 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-02-26 05:24:26 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-28 18:44:08 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-03-01 00:18:43 from Rod Taylor <rod(dot)taylor(at)gmail(dot)com>
2011-02-26 13:38:31 from Rod Taylor <rod(dot)taylor(at)gmail(dot)com>
2011-02-27 07:59:44 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-02-25 23:41:09 from Josh Berkus <josh(at)agliodbs(dot)com>
2011-02-26 05:29:14 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-26 06:57:54 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-02-26 14:46:55 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-27 08:03:10 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-02-27 17:44:35 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-27 22:17:49 from Josh Berkus <josh(at)agliodbs(dot)com>
2011-02-28 15:13:39 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-28 18:04:54 from Josh Berkus <josh(at)agliodbs(dot)com>
2011-02-28 18:19:46 from Martijn van Oosterhout <kleptog(at)svana(dot)org>
2011-02-28 18:24:13 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-28 18:31:29 from Josh Berkus <josh(at)agliodbs(dot)com>
2011-02-28 18:50:03 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-02-28 18:54:23 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-28 19:31:53 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-02-28 19:37:23 from Michael Glaesemann <grzm(at)seespotcode(dot)net>
2011-02-28 19:39:19 from Josh Berkus <josh(at)agliodbs(dot)com>
2011-02-28 19:47:23 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2011-02-28 20:02:30 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-03-02 12:29:59 from Bernd Helmle <mailings(at)oopsware(dot)de>
2011-02-28 20:24:41 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-03-01 08:50:25 from Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
2011-02-28 19:47:22 from Euler Taveira de Oliveira <euler(at)timbira(dot)com>
2011-02-28 20:03:33 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-02-28 21:13:47 from Greg Stark <gsstark(at)mit(dot)edu>
2011-02-28 22:05:08 from Josh Berkus <josh(at)agliodbs(dot)com>
2011-02-28 22:52:00 from Chris Browne <cbbrowne(at)acm(dot)org>
2011-02-28 22:35:28 from Robert Treat <rob(at)xzilla(dot)net>
2011-02-26 09:33:14 from Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
2011-02-26 14:45:24 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-26 18:12:42 from PostgreSQL - Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
2011-02-26 18:44:52 from Greg Stark <gsstark(at)mit(dot)edu>
2011-02-26 18:58:20 from Martijn van Oosterhout <kleptog(at)svana(dot)org>
2011-02-26 20:10:46 from Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
2011-02-27 08:01:18 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-02-27 17:24:43 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-24 01:09:10 from Josh Berkus <josh(at)agliodbs(dot)com>
2011-02-24 03:11:11 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-24 03:30:08 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-02-24 03:58:08 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-02-24 15:07:35 from Bruce Momjian <bruce(at)momjian(dot)us>
2011-02-24 06:13:36 from PostgreSQL - Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
Lists:
pgsql-hackers
On Feb 23, 2011, at 3:46 PM, Robert Haas wrote:
> On Wed, Feb 23, 2011 at 12:50 AM, Nathan Boley <npboley(at)gmail(dot)com> wrote:
>>> Personally, I think the first thing we ought to do is add a real, bona
>>> fide planner hint to override the selectivity calculation manually,
>>> maybe something like this:
>>>
>>> WHERE (x < 5 AND y = 1) SELECTIVITY (0.1);
>>
>> If you're going to go that far, why not just collect statistics on
>> that specific predicate?
>>
>> ie, ANALYZE SELECTIVITY ON tablename (x, y) WHERE (x < 5 AND y = 1);
>>
>> Then it won't fall subject to all of the pitfalls that Tom outlines below.
>>
>> Selectivities are easy to estimate if we know the predicate. They only
>> become hard when they have to work for every possible predicate.
>
> Fair point.
>
> --
> Robert Haas
basically we got the idea of allowing "expressions" in cross column stuff. i think this can be very useful. it would fix the problem of a query like that:
SELECT * FROM table WHERE cos(field) = some_number;
this takes a constant fraction of the table which is usually plain wrong as well (and the error tends to multiply inside the plan).
i am just not sure if i have understood all corner cases of that already.
ultimate goal: get it right for join estimates (this is why a syntax extension is definitely needed - you cannot track all of them automatically).
many thanks,
hans
--
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
In response to
pgsql-hackers by date
Next :From: Alexander KorotkovDate: 2011-02-23 15:00:09
Subject : WIP: collect frequency statistics for arrays
Previous :From : PostgreSQL - Hans-Jürgen SchönigDate : 2011-02-23 14:54:11
Subject : Re: WIP: cross column correlation ...