diff --git modules/field/modules/field_sql_storage/field_sql_storage.install modules/field/modules/field_sql_storage/field_sql_storage.install
index 554660e..b1d38e3 100644
--- modules/field/modules/field_sql_storage/field_sql_storage.install
+++ modules/field/modules/field_sql_storage/field_sql_storage.install
@@ -122,5 +122,15 @@ function field_sql_storage_update_7000() {
 }
 
 /**
+ * Remove 'field_sql_storage_ENTITYTYPE_etid' system variables.
+ */
+function field_sql_storage_update_7001() {
+  $types = db_query('SELECT type, etid FROM {field_config_entity_type}')->fetchAllKeyed();
+  foreach ($types as $entity_type => $etid) {
+    variable_del('field_sql_storage_' . $entity_type . '_etid');
+  }
+}
+
+/**
  * @} End of "defgroup field-updates-6.x-to-7.x"
  */
diff --git modules/field/modules/field_sql_storage/field_sql_storage.module modules/field/modules/field_sql_storage/field_sql_storage.module
index f2e6430..0a886fc 100644
--- modules/field/modules/field_sql_storage/field_sql_storage.module
+++ modules/field/modules/field_sql_storage/field_sql_storage.module
@@ -96,21 +96,44 @@ function _field_sql_storage_indexname($name, $index) {
 }
 
 /**
- * Retrieve or assign an entity type id for an entity type.
+ * Retrieve or assign an entity type ID for an entity type.
  *
  * @param $entity_type
- *   The entity type, such as 'node' or 'user'.
- * @return
- *   The entity type id.
+ *   (optional) The entity type, such as 'node' or 'user'.
  *
+ * @return
+ *   The entity type ID, if $entity_type as passed, or an associative array
+ *   containing the entire type-ID mapping.
  */
-function _field_sql_storage_etid($entity_type) {
-  $etid = variable_get('field_sql_storage_' . $entity_type . '_etid', NULL);
-  if (!isset($etid)) {
-    $etid = db_insert('field_config_entity_type')->fields(array('type' => $entity_type))->execute();
-    variable_set('field_sql_storage_' . $entity_type . '_etid', $etid);
+function _field_sql_storage_etid($entity_type = NULL) {
+  $types = &drupal_static(__FUNCTION__);
+  $write_cache = FALSE;
+
+  if (!isset($types)) {
+    if ($cache = cache_get('entity_type_ids', 'cache_bootstrap')) {
+      $types = $cache->data;
+    }
+    else {
+      $types = db_query('SELECT type, etid FROM {field_config_entity_type}')->fetchAllKeyed();
+      $write_cache = TRUE;
+    }
+  }
+
+  if (isset($entity_type) && !isset($types[$entity_type])) {
+    $types[$entity_type] = db_insert('field_config_entity_type')
+      ->fields(array('type' => $entity_type))
+      ->execute();
+    $write_cache = TRUE;
+  }
+
+  if ($write_cache) {
+    cache_set('entity_type_ids', $types, 'cache_bootstrap');
+  }
+
+  if (isset($entity_type)) {
+    return $types[$entity_type];
   }
-  return $etid;
+  return $types;
 }
 
 /**
diff --git modules/field/modules/field_sql_storage/field_sql_storage.test modules/field/modules/field_sql_storage/field_sql_storage.test
index bbef5cc..60df34b 100644
--- modules/field/modules/field_sql_storage/field_sql_storage.test
+++ modules/field/modules/field_sql_storage/field_sql_storage.test
@@ -42,8 +42,6 @@ class FieldSqlStorageTestCase extends DrupalWebTestCase {
     $t2 = _field_sql_storage_etid('t2');
 
     $this->assertEqual($t1+1, $t2, 'Entity type ids are sequential');
-    $this->assertIdentical(variable_get('field_sql_storage_t1_etid', NULL), $t1, 'First entity type variable is correct');
-    $this->assertIdentical(variable_get('field_sql_storage_t2_etid', NULL), $t2, 'Second entity type variable is correct');
     $this->assertEqual(db_query("SELECT etid FROM {field_config_entity_type} WHERE type='t1'")->fetchField(), $t1, 'First entity type in database is correct');
     $this->assertEqual(db_query("SELECT etid FROM {field_config_entity_type} WHERE type='t2'")->fetchField(), $t2, 'Second entity type in database is correct');
     $this->assertEqual($t1, _field_sql_storage_etid('t1'), '_field_sql_storage_etid returns the same value for the first entity type');
diff --git modules/node/node.module modules/node/node.module
index 81009e7..b402018 100644
--- modules/node/node.module
+++ modules/node/node.module
@@ -3236,7 +3236,7 @@ function _node_query_node_access_alter($query, $base_table, $type) {
   if ($type == 'entity' && count($entity_conditions->conditions())) {
     // All the node access conditions are only for field values belonging to
     // nodes.
-    $etid = variable_get('field_sql_storage_node_etid');
+    $etid = _field_sql_storage_etid('node');
     $entity_conditions->condition("$base_alias.etid", $etid);
     $or = db_or();
     $or->condition($entity_conditions);
