You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2010/05/07 21:59:36 UTC

[Couchdb Wiki] Update of "Regenerating_views_on_update" by SebastianCohnen

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Regenerating_views_on_update" page has been changed by SebastianCohnen.
The comment on this change is: added toc, added syntax hl.
http://wiki.apache.org/couchdb/Regenerating_views_on_update?action=diff&rev1=8&rev2=9

--------------------------------------------------

  = Update views on document save =
+ <<TableOfContents(3)>>
  
  CouchDB defaults to regenerating views the first time they are accessed. This behavior is preferable in most cases as it optimizes the resource utilization on the database server. 
  On the other hand, in some situations the benefit of always having fast and updated views far outweigh the cost of regenerating them every time the database server receives updates. This can be achieved by supplying an updater script that calls the views when needed.
@@ -8, +9 @@

  == Example using ruby ==
  
  === couch.ini ===
- (0.8) Add the following line to the couch.ini file {{{
+ (0.8) Add the following line to the couch.ini file
+ {{{
- 	DbUpdateNotificationProcess=/PATH/TO/view_updater.rb
+ DbUpdateNotificationProcess=/PATH/TO/view_updater.rb
  }}}
  
- (0.9) Add the following section to the local.ini file: {{{
+ (0.9+) Add the following section to the local.ini file:
+ {{{
  [update_notification]
  view_updater=/PATH/TO/view_updater.rb
  }}}  
@@ -20, +23 @@

  === view_updater.rb ===
  The following script updates the views for each tenth update made to the database or at most once every second when a lot of saves are performed 
  
+ {{{#!highlight ruby
- {{{
- 
  #!/usr/bin/ruby
  
  ###################
@@ -120, +122 @@

  
  == Example using Python ==
  
- {{{
+ {{{#!highlight python
  
  #!/usr/bin/env python
  # -*- coding: utf-8 -*-