Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2014-02-18 Thread Heikki Linnakangas
On 02/16/2014 10:19 PM, Jim Nasby wrote: On 1/24/14, 3:52 PM, Jaime Casanova wrote: On Tue, Dec 3, 2013 at 11:25 AM, Bruce Momjianbr...@momjian.us wrote: Is everyone else OK with this approach? Updated patch attached. Hi, I started to look at this patch and i found that it fails an

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2014-02-16 Thread Andres Freund
On 2014-02-15 21:34:15 -0500, Bruce Momjian wrote: Thank you for the thorough review. Unless someone else can complete this, I think it should be marked as returned with feedback. I don't think I am going to learn enough to complete this during the commit-fest. Agreed. Marked it as such.

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2014-02-16 Thread Jim Nasby
On 1/24/14, 3:52 PM, Jaime Casanova wrote: On Tue, Dec 3, 2013 at 11:25 AM, Bruce Momjianbr...@momjian.us wrote: Is everyone else OK with this approach? Updated patch attached. Hi, I started to look at this patch and i found that it fails an assertion as soon as you run a VACUUM FULL

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2014-02-15 Thread Andres Freund
Hi, *** end_heap_rewrite(RewriteState state) *** 281,286 --- 284,290 true); RelationOpenSmgr(state-rs_new_rel); + update_page_vm(state-rs_new_rel, state-rs_buffer, state-rs_blockno);

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2014-02-15 Thread Bruce Momjian
On Sat, Feb 15, 2014 at 04:16:40PM +0100, Andres Freund wrote: Hi, *** end_heap_rewrite(RewriteState state) *** 281,286 --- 284,290 true); RelationOpenSmgr(state-rs_new_rel); +

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2014-02-15 Thread Andres Freund
On 2014-02-15 12:50:14 -0500, Bruce Momjian wrote: On Sat, Feb 15, 2014 at 04:16:40PM +0100, Andres Freund wrote: Hi, *** end_heap_rewrite(RewriteState state) *** 281,286 --- 284,290 true);

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2014-02-15 Thread Bruce Momjian
On Sat, Feb 15, 2014 at 07:08:40PM +0100, Andres Freund wrote: Can you be more specific about the cluster.c idea? I see copy_heap_data() in cluster.c calling HeapTupleSatisfiesVacuum() with a 'buf' just like the code I am working in. Yes, it does. But in contrast to your patch it does so

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2014-01-24 Thread Jaime Casanova
On Tue, Dec 3, 2013 at 11:25 AM, Bruce Momjian br...@momjian.us wrote: Is everyone else OK with this approach? Updated patch attached. Hi, I started to look at this patch and i found that it fails an assertion as soon as you run a VACUUM FULL after a lazy VACUUM even if those are on

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2014-01-24 Thread Bruce Momjian
On Fri, Jan 24, 2014 at 04:52:55PM -0500, Jaime Casanova wrote: On Tue, Dec 3, 2013 at 11:25 AM, Bruce Momjian br...@momjian.us wrote: Is everyone else OK with this approach? Updated patch attached. Hi, I started to look at this patch and i found that it fails an assertion as soon

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2014-01-15 Thread Simon Riggs
On 28 November 2013 22:17, Robert Haas robertmh...@gmail.com wrote: The fact that you've needed to modify SetHintBits() to make this work is pretty nasty. I'm not exactly sure what to do about that, but it doesn't seem good. That makes me feel bad also. I think we should be looking for some

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-12-03 Thread Bruce Momjian
On Thu, Nov 28, 2013 at 05:38:05PM -0500, Bruce Momjian wrote: I wonder if we ought to mark each page as all-visible in raw_heap_insert() when we first initialize it, and then clear the flag when we come across a tuple that isn't all-visible. We could try to set hint bits on the tuple

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-12-03 Thread Robert Haas
On Tue, Dec 3, 2013 at 11:25 AM, Bruce Momjian br...@momjian.us wrote: On Thu, Nov 28, 2013 at 05:38:05PM -0500, Bruce Momjian wrote: I wonder if we ought to mark each page as all-visible in raw_heap_insert() when we first initialize it, and then clear the flag when we come across a tuple

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-12-03 Thread Bruce Momjian
On Tue, Dec 3, 2013 at 02:01:52PM -0500, Robert Haas wrote: On Tue, Dec 3, 2013 at 11:25 AM, Bruce Momjian br...@momjian.us wrote: On Thu, Nov 28, 2013 at 05:38:05PM -0500, Bruce Momjian wrote: I wonder if we ought to mark each page as all-visible in raw_heap_insert() when we first

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-11-28 Thread Robert Haas
On Wed, Nov 27, 2013 at 4:33 PM, Bruce Momjian br...@momjian.us wrote: On Sat, Jan 12, 2013 at 02:14:03PM -0500, Kevin Grittner wrote: Amit Kapila wrote: On Thursday, January 10, 2013 6:09 AM Josh Berkus wrote: Surely VACUUM FULL should rebuild the visibility map, and make tuples in the

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-11-28 Thread Bruce Momjian
On Thu, Nov 28, 2013 at 05:17:07PM -0500, Robert Haas wrote: I need to know this is the right approach, and need to know what things are wrong or missing. The fact that you've needed to modify SetHintBits() to make this work is pretty nasty. I'm not exactly sure what to do about that, but

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-11-27 Thread Bruce Momjian
On Sat, Jan 12, 2013 at 02:14:03PM -0500, Kevin Grittner wrote: Amit Kapila wrote: On Thursday, January 10, 2013 6:09 AM Josh Berkus wrote: Surely VACUUM FULL should rebuild the visibility map, and make tuples in the new relation all-visible, no? Certainly it seems odd to me that

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-01-12 Thread Kevin Grittner
Amit Kapila wrote: On Thursday, January 10, 2013 6:09 AM Josh Berkus wrote: Surely VACUUM FULL should rebuild the visibility map, and make tuples in the new relation all-visible, no? Certainly it seems odd to me that VACUUM FULL leaves the the table in a less-well maintained state in terms of

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-01-10 Thread Amit Kapila
On Thursday, January 10, 2013 12:01 PM Pavan Deolasee wrote: On Thu, Jan 10, 2013 at 11:45 AM, Amit Kapila amit.kap...@huawei.com wrote: On Thursday, January 10, 2013 6:09 AM Josh Berkus wrote: Surely VACUUM FULL should rebuild the visibility map, and make tuples in the new relation

[HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-01-09 Thread Bruce Momjian
How do we want to handle the case where VACUUM FULL clears the visibility map, causing loss of index-only scans? http://archives.postgresql.org/pgsql-performance/2012-11/msg00317.php Do we document this behavior or add a TODO item? -- Bruce Momjian br...@momjian.us

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-01-09 Thread Josh Berkus
On 01/09/2013 03:07 PM, Bruce Momjian wrote: How do we want to handle the case where VACUUM FULL clears the visibility map, causing loss of index-only scans? http://archives.postgresql.org/pgsql-performance/2012-11/msg00317.php Do we document this behavior or add a TODO item?

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-01-09 Thread Amit Kapila
On Thursday, January 10, 2013 6:09 AM Josh Berkus wrote: On 01/09/2013 03:07 PM, Bruce Momjian wrote: How do we want to handle the case where VACUUM FULL clears the visibility map, causing loss of index-only scans? http://archives.postgresql.org/pgsql-performance/2012-

Re: [HACKERS] 9.2.1 index-only scans : abnormal heap fetches after VACUUM FULL

2013-01-09 Thread Pavan Deolasee
On Thu, Jan 10, 2013 at 11:45 AM, Amit Kapila amit.kap...@huawei.com wrote: On Thursday, January 10, 2013 6:09 AM Josh Berkus wrote: Surely VACUUM FULL should rebuild the visibility map, and make tuples in the new relation all-visible, no? I think it cannot made all visible. How about if