From:
Simon Riggs <simon(at)2ndQuadrant(dot)com>
To:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc:
Jeff Janes <jeff(dot)janes(at)gmail(dot)com>,
pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject:
Re: [PERFORM] Slow query: bitmap scan troubles
Date:
2013-01-06 18:19:10
Message-ID:
CA+U5nMLJBrnU+B6md5VR1GHGz6Ji5MEZd6QE+favQYLjv9H8JA@mail.gmail.com (view raw or flat )
Thread:
2012-12-04 15:06:48 from <postgresql(at)foo(dot)me(dot)uk>
2012-12-04 15:21:17 from <postgresql(at)foo(dot)me(dot)uk>
2012-12-04 15:27:57 from Claudio Freire <klaussfreire(at)gmail(dot)com>
2012-12-04 17:22:29 from Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
2012-12-04 17:25:56 from Claudio Freire <klaussfreire(at)gmail(dot)com>
2012-12-04 17:35:32 from "Philip Scott" <pscott(at)foo(dot)me(dot)uk>
2012-12-04 17:47:29 from <postgresql(at)foo(dot)me(dot)uk>
2012-12-04 18:50:41 from Vitalii Tymchyshyn <tivv00(at)gmail(dot)com>
2012-12-04 18:55:17 from "Philip Scott" <pscott(at)foo(dot)me(dot)uk>
2012-12-04 18:56:04 from <postgresql(at)foo(dot)me(dot)uk>
2012-12-04 20:11:53 from Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
2012-12-06 12:56:26 from <postgresql(at)foo(dot)me(dot)uk>
2012-12-04 22:34:42 from Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
2012-12-04 18:03:29 from <postgresql(at)foo(dot)me(dot)uk>
2012-12-04 18:31:50 from Claudio Freire <klaussfreire(at)gmail(dot)com>
2012-12-04 23:42:21 from Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
2012-12-05 17:39:35 from Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
2012-12-05 17:43:49 from Claudio Freire <klaussfreire(at)gmail(dot)com>
2012-12-06 17:27:48 from Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
2012-12-06 20:05:09 from Claudio Freire <klaussfreire(at)gmail(dot)com>
2012-12-06 21:09:54 from Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
2012-12-05 18:05:10 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-12-06 12:52:07 from <postgresql(at)foo(dot)me(dot)uk>
2012-12-18 06:00:16 from Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
2013-01-05 22:18:16 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-06 16:29:17 from Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
2013-01-06 18:18:03 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-06 18:22:33 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2013-01-06 18:19:10 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2013-01-06 18:58:40 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-06 19:47:48 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2013-01-06 23:03:05 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-06 23:17:23 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-07 00:03:04 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2013-01-07 17:35:51 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-07 18:03:37 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2013-01-07 18:27:38 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-07 18:48:12 from Claudio Freire <klaussfreire(at)gmail(dot)com>
2013-01-11 01:07:34 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-14 16:45:01 from Robert Haas <robertmhaas(at)gmail(dot)com>
2013-01-14 17:23:17 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-14 17:50:24 from Robert Haas <robertmhaas(at)gmail(dot)com>
2013-01-14 17:56:37 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-15 19:46:39 from Bruce Momjian <bruce(at)momjian(dot)us>
2013-01-15 20:11:02 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-12-19 01:05:05 from Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
2012-12-19 14:40:54 from Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
2012-12-06 14:10:29 from <postgresql(at)foo(dot)me(dot)uk>
2012-12-08 15:15:42 from Guillaume Lelarge <guillaume(at)lelarge(dot)info>
2012-12-10 09:52:42 from <postgresql(at)foo(dot)me(dot)uk>
2012-12-04 18:31:05 from "Philip Scott" <pscott(at)foo(dot)me(dot)uk>
2012-12-04 18:32:57 from Claudio Freire <klaussfreire(at)gmail(dot)com>
2012-12-04 18:54:29 from <postgresql(at)foo(dot)me(dot)uk>
Lists:
pgsql-hackers pgsql-performance
On 5 January 2013 22:18, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> But I am wondering if it should be present at all in 9.3. When it was
>> introduced, the argument seemed to be that smaller indexes might be easier
>> to keep in cache.
>
> No. The argument is that if we don't have some such correction, the
> planner is liable to believe that different-sized indexes have *exactly
> the same cost*, if a given query would fetch the same number of index
> entries.
The only difference between a large and a small index is the initial
fetch, since the depth of the index may vary. After that the size of
the index is irrelevant to the cost of the scan, since we're just
scanning across the leaf blocks. (Other differences may exist but not
related to size).
Perhaps the cost of the initial fetch is what you mean by a
"correction"? In that case, why not use the index depth directly from
the metapage, rather than play with size?
--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
In response to
Responses
pgsql-performance by date
Next :From: Simon RiggsDate: 2013-01-06 18:22:33
Subject : Re: [PERFORM] Slow query: bitmap scan troubles
Previous :From : Tom LaneDate : 2013-01-06 18:18:03
Subject : Re: [PERFORM] Slow query: bitmap scan troubles
pgsql-hackers by date
Next :From: Simon RiggsDate: 2013-01-06 18:22:33
Subject : Re: [PERFORM] Slow query: bitmap scan troubles
Previous :From : Tom LaneDate : 2013-01-06 18:18:03
Subject : Re: [PERFORM] Slow query: bitmap scan troubles