# File lib/rubyrep/logged_change_loader.rb, line 97
    def update(options = {:forced => false, :expire_time => 1})
      return unless options[:forced] or Time.now - self.last_updated >= options[:expire_time]
      
      self.last_updated = Time.now

      # First, let's use a LIMIT clause (via :row_buffer_size option) to verify
      # if there are any pending changes.
      # (If there are many pending changes, this is (at least with PostgreSQL)
      # much faster.)
      cursor = connection.select_cursor(
        :table => change_log_table,
        :from => {'id' => current_id},
        :exclude_starting_row => true,
        :row_buffer_size => 1
      )
      return unless cursor.next?

      # Something is here. Let's actually load it.
      cursor = connection.select_cursor(
        :table => change_log_table,
        :from => {'id' => current_id},
        :exclude_starting_row => true,
        :type_cast => true,
        :row_buffer_size => session.configuration.options[:row_buffer_size]
      )
      while cursor.next?
        change = cursor.next_row
        self.current_id = change['id']
        self.change_array << change
        change['array_index'] = self.change_array.size - 1

        table_change_tree = change_tree[change['change_table']] ||= {}
        key_changes = table_change_tree[change['change_key']] ||= []
        key_changes << change
      end
      cursor.clear
    end