Update a field without saving the full node in Drupal

Use field_attach_update() instead of node_save():

<?php
/**
 * Update votes of all entries.
 */
function votes_update() {

  // Get all nodes of 'entry' content type 
  // Note that using EntityFieldQuery would make the code portable to other storage engines
  $query = db_select('node', 'n');
  $query->fields('n', array('nid'));
  $query->condition('n.type', 'entry', '=');
  $nids = $query->execute()->fetchCol();

  // Get the 'vote' flag (http://drupal.org/project/flag)
  $flag = flag_get_flag('vote');

  // Load all nodes. This would have worked instead of the query too:
  // node_load_multiple(array(), array('type' => 'entry'));
  $nodes = node_load_multiple($nids);
  foreach ($nodes as $node) {

    // Get all the flags of that node.
    $count = $flag->get_count($node->nid);
    if (is_numeric($count)) {

      $node->field_votes[LANGUAGE_NONE][0]['value'] = $count;

      // It's good to call field_attach_presave() too
      field_attach_presave('node', $node);
      field_attach_update('node', $node);
    }
  }
}

In the example above, we could had got the 'votes' field directly in the query, without the need to execute the more expensive node_load() / entity_load() functions.