Unix Technical Forum

Reindex - Is this necessary after a vacuum?

This is a discussion on Reindex - Is this necessary after a vacuum? within the Pgsql Performance forums, part of the PostgreSQL category; --> We are reindexing frequently, and I'm wondering if this is really necessary, given that it appears to take an ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:35 PM
Markus Benne
 
Posts: n/a
Default Reindex - Is this necessary after a vacuum?

We are reindexing frequently, and I'm wondering if
this is really necessary, given that it appears to
take an exclusive lock on the table.

Our table in question is vacuumed every 4 minutes, and
we are reindexing after each one.

I'm not a fan of locking this table that frequently,
even if it is only for 5 - 10 seconds depending on
load.

The vacuum is a standard vacuum. Nightly we do a
vacuum analyze.

Thanks for any tips,
....Markus

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:36 PM
Richard Huxton
 
Posts: n/a
Default Re: Reindex - Is this necessary after a vacuum?

Markus Benne wrote:
> We are reindexing frequently, and I'm wondering if
> this is really necessary, given that it appears to
> take an exclusive lock on the table.
>
> Our table in question is vacuumed every 4 minutes, and
> we are reindexing after each one.
>
> I'm not a fan of locking this table that frequently,
> even if it is only for 5 - 10 seconds depending on
> load.
>
> The vacuum is a standard vacuum. Nightly we do a
> vacuum analyze.


At most I'd do a nightly reindex. And in fact, I'd probably drop the
index, full vacuum, recreate index.

But you only need to reindex at all if you have a specific problem with
the index bloating. Are you seeing this?

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 12:36 PM
Tom Lane
 
Posts: n/a
Default Re: Reindex - Is this necessary after a vacuum?

Markus Benne <thing@m-bass.com> writes:
> Our table in question is vacuumed every 4 minutes, and
> we are reindexing after each one.


That's pretty silly. You might need a reindex once in awhile, but
not every time you vacuum.

The draft 8.1 docs contain some discussion of possible reasons for
periodic reindexing:
http://developer.postgresql.org/docs...e-reindex.html
but none of these reasons justify once-per-vacuum reindexes.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:54 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com