Re: [PERFORM] Index Bloat Problem

2012-08-18 Thread Greg Williamson
gt;Cc: pgsql-performance@postgresql.org >Sent: Friday, August 17, 2012 7:33 PM >Subject: Re: [PERFORM] Index Bloat Problem > >On Thu, Aug 16, 2012 at 12:57 PM, Strahinja Kustudić > wrote: >> >> @Jeff I'm not sure if I understand what you mean? I know that we never reus

Re: [PERFORM] Index Bloat Problem

2012-08-17 Thread Jeff Janes
On Thu, Aug 16, 2012 at 12:57 PM, Strahinja Kustudić wrote: > > @Jeff I'm not sure if I understand what you mean? I know that we never reuse > key ranges. Could you be more clear, or give an example please. If an index leaf page is completely empty because every entry on it were deleted, it will

Re: [PERFORM] Index Bloat Problem

2012-08-16 Thread Strahinja Kustudić
Thanks for the help everyone and sorry for not replying sooner, I was on a business trip. @Hubert pg_reorg looks really interesting and from the first read it looks to be a very good solution for maintenance, but for now I would rather try to slow down, or remove this bloat, so I have to do as les

Re: [PERFORM] Index Bloat Problem

2012-08-13 Thread Jeff Janes
On Fri, Aug 10, 2012 at 3:15 PM, Strahinja Kustudić wrote: > > For example, yesterday when I checked the database size on the production > server it was 30GB, and the restored dump of that database was only 17GB. > The most interesting thing is that the data wasn't bloated that much, but > the ind

Re: [PERFORM] Index Bloat Problem

2012-08-13 Thread Mark Kirkwood
On 11/08/12 10:15, Strahinja Kustudić wrote: We have PostgreSQL 9.1 running on Centos 5 on two SSDs, one for indices and one for data. The database is extremely active with reads and writes. We have autovacuum enabled, but we didn't tweak it's aggressiveness. The problem is that after some time t

Re: [PERFORM] Index Bloat Problem

2012-08-11 Thread hubert depesz lubaczewski
On Sat, Aug 11, 2012 at 12:15:11AM +0200, Strahinja Kustudić wrote: > Is there a way to make the autovacuum daemon more aggressive, since I'm not > exactly sure how to do that in this case? Would that even help? Is there > another way to remove this index bloat? http://www.depesz.com/index.php/201

[PERFORM] Index Bloat Problem

2012-08-10 Thread Strahinja Kustudić
We have PostgreSQL 9.1 running on Centos 5 on two SSDs, one for indices and one for data. The database is extremely active with reads and writes. We have autovacuum enabled, but we didn't tweak it's aggressiveness. The problem is that after some time the database grows even more than 100% on the fi

Re: [PERFORM] Index bloat problem?

2005-04-22 Thread a3a18850
Quoting Bill Chandler <[EMAIL PROTECTED]>: > Running PostgreSQL 7.4.2, Solaris. > Client is reporting that the size of an index is > greater than the number of rows in the table (1.9 > million vs. 1.5 million). Index was automatically > created from a 'bigserial unique' column. > We have been ru

Re: [PERFORM] Index bloat problem?

2005-04-22 Thread Tom Lane
"David Roussel" <[EMAIL PROTECTED]> writes: > Note there is no reference to iso_pjm_data_update_events_event_id_key > which is the index that went wacky on us. Does that seem weird to you? What that says is that that index doesn't belong to that table. You sure it wasn't a chance coincidence of

Re: [PERFORM] Index bloat problem?

2005-04-22 Thread Jim C. Nasby
You would be interested in http://archives.postgresql.org/pgsql-hackers/2005-04/msg00565.php On Thu, Apr 21, 2005 at 03:33:05PM -0400, Dave Chapeskie wrote: > On Thu, Apr 21, 2005 at 11:28:43AM -0700, Josh Berkus wrote: > > Michael, > > > > > Every five minutes, DBCC INDEXDEFRAG will report t

Re: [PERFORM] Index bloat problem?

2005-04-22 Thread David Roussel
On Fri, 22 Apr 2005 10:06:33 -0400, "Tom Lane" <[EMAIL PROTECTED]> said: > David Roussel <[EMAIL PROTECTED]> writes: > > |dave_data_update_eventsr 1593600.0 40209 > > |dave_data_update_events_event_id_key i 1912320.0 29271 > > Hmm ... what PG version is this, and what

Re: [PERFORM] Index bloat problem?

2005-04-22 Thread Tom Lane
David Roussel <[EMAIL PROTECTED]> writes: > |dave_data_update_eventsr 1593600.0 40209 > |dave_data_update_events_event_id_key i 1912320.0 29271 Hmm ... what PG version is this, and what does VACUUM VERBOSE on that table show? regards, tom lane

Re: [PERFORM] Index bloat problem?

2005-04-22 Thread David Roussel
On 22 Apr 2005, at 06:57, Tom Lane wrote: Bill Chandler <[EMAIL PROTECTED]> writes: Client is reporting that the size of an index is greater than the number of rows in the table (1.9 million vs. 1.5 million). This thread seems to have wandered away without asking the critical question "what did you

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Tom Lane
Bill Chandler <[EMAIL PROTECTED]> writes: > Client is reporting that the size of an index is > greater than the number of rows in the table (1.9 > million vs. 1.5 million). This thread seems to have wandered away without asking the critical question "what did you mean by that?" It's not possible

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread John A Meinel
Bill Chandler wrote: Mischa, Thanks. Yes, I understand that not having a large enough max_fsm_pages is a problem and I think that it is most likely the case for the client. What I wasn't sure of was if the index bloat we're seeing is the result of the "bleeding" you're talking about or something

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Josh Berkus
Bill, > If I deleted 75% of the rows but had a max_fsm_pages > setting that still exceeded the pages required (as > indicated in VACUUM output), would that solve my > indexing problem or would I still need to REINDEX > after such a purge? Depends on the performance you're expecting.The FSM re

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Bill Chandler
Mischa, Thanks. Yes, I understand that not having a large enough max_fsm_pages is a problem and I think that it is most likely the case for the client. What I wasn't sure of was if the index bloat we're seeing is the result of the "bleeding" you're talking about or something else. If I deleted

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Mischa Sandberg
Quoting Bill Chandler <[EMAIL PROTECTED]>: > ... The normal activity is to delete 3-5% of the rows per day, > followed by a VACUUM ANALYZE. ... > However, on occasion, deleting 75% of rows is a > legitimate action for the client to take. > > In case nobody else has asked: is your max_fsm_page

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Josh Berkus
Dave, > See http://archives.postgresql.org/pgsql-general/2005-03/msg01465.php > for my thoughts on a non-blocking alternative to REINDEX. I got no > replies to that message. :-( Well, sometimes you have to be pushy. Say, "Hey, comments please?" The hackers list is about 75 posts a day, it's e

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Dave Chapeskie
On Thu, Apr 21, 2005 at 11:28:43AM -0700, Josh Berkus wrote: > Michael, > > > Every five minutes, DBCC INDEXDEFRAG will report to the user an > > estimated percentage completed. DBCC INDEXDEFRAG can be terminated at > > any point in the process, and *any completed work is retained.*" > > Keen

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Alex Turner
Same thing happens in Oracle ALTER INDEX rebuild To force a rebuild. It will mark the free blocks as 'free' below the PCTFREE value for the tablespace. Basically If you build an index with entries. and each entry is 1/4 of a block, the database will write 2500 blocks to the disk. If you

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Bill Chandler
--- [EMAIL PROTECTED] wrote: > I gather you mean, out-of-the-ordinary for most > apps, but not for this client? Actually, no. The normal activity is to delete 3-5% of the rows per day, followed by a VACUUM ANALYZE. Then over the course of the day (in multiple transactions) about the same amount

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Josh Berkus
Michael, > Every five minutes, DBCC INDEXDEFRAG will report to the user an > estimated percentage completed. DBCC INDEXDEFRAG can be terminated at > any point in the process, and *any completed work is retained.*" Keen. Sounds like something for our TODO list. -- Josh Berkus Aglio Database

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Michael Guerin
Is this a common issue among all RDBMSs or is it something that is PostgreSQL specific? Speaking from experience, this sort of thing affects MSSQL as well, although the maintenance routines are different. Yes, this is true with MSSQL too, however sql server implements a defrag index

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Chris Browne
josh@agliodbs.com (Josh Berkus) writes: > Bill, > >> What about if an out-of-the-ordinary number of rows >> were deleted (say 75% of rows in the table, as opposed >> to normal 5%) followed by a 'VACUUM ANALYZE'?  Could >> things get out of whack because of that situation? > > Yes. You'd want to ru

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Josh Berkus
Alex, > REINDEX DATABASE blah > > supposed to rebuild all indices in the database, or must you specify > each table individualy? (I'm asking because I just tried it and it > only did system tables) "DATABASE Recreate all system indexes of a specified database. Indexes on user tables are not pr

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Alex Turner
Is: REINDEX DATABASE blah supposed to rebuild all indices in the database, or must you specify each table individualy? (I'm asking because I just tried it and it only did system tables) Alex Turner netEconomist On 4/21/05, Josh Berkus wrote: > Bill, > > > What about if an out-of-the-ordinary

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Josh Berkus
Bill, > Honestly, this seems like an inordinate amount of > babysitting for a production application. I'm not > sure if the client will be willing to accept it. Well, then, tell them not to delete 75% of the rows in a table at once. I imagine that operation brought processing to a halt, too.

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Josh Berkus
Bill, > Honestly, this seems like an inordinate amount of > babysitting for a production application. I'm not > sure if the client will be willing to accept it. Well, then, tell them not to delete 75% of the rows in a table at once. I imagine that operation brought processing to a halt, too.

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Bill Chandler
--- Josh Berkus wrote: > Bill, > > > What about if an out-of-the-ordinary number of > rows > > were deleted (say 75% of rows in the table, as > opposed > > to normal 5%) followed by a 'VACUUM ANALYZE'? >  Could > > things get out of whack because of that situation? > > Yes. You'd want to run R

Re: [PERFORM] Index bloat problem?

2005-04-21 Thread Josh Berkus
Bill, > What about if an out-of-the-ordinary number of rows > were deleted (say 75% of rows in the table, as opposed > to normal 5%) followed by a 'VACUUM ANALYZE'?  Could > things get out of whack because of that situation? Yes. You'd want to run REINDEX after and event like that. As you shoul

[PERFORM] Index bloat problem?

2005-04-21 Thread Bill Chandler
All, Running PostgreSQL 7.4.2, Solaris. Client is reporting that the size of an index is greater than the number of rows in the table (1.9 million vs. 1.5 million). Index was automatically created from a 'bigserial unique' column. Database contains several tables with exactly the same columns (