I have a field which looks corrupted. How should I remove all traces of it?
This is totally off the top of my head so use with much caution, and after taking lots of backups!

// Remove taxonomy index records. Do this BEFORE removing field data tables.
$indexed_tids = db_query("SELECT field_foo_tid FROM field_data_field_foo WHERE entity_type = 'node' AND bundle = 'bundle_field_is_attached_to'")-&gt;fetchCol();
db_delete('taxonomy_index')-&gt;condition('tid', $indexed_tids)-&gt;execute();

// Remove the field data tables completely
db_drop_table('field_data_field_foo');
db_drop_table('field_revision_field_foo');

// Remove the field config
db_delete('field_config')-&gt;condition('field_name', 'field_foo')-&gt;execute();
db_delete('field_config_instance')-&gt;condition('field_name', 'field_foo')-&gt;execute();

// Clear up
drupal_flush_all_caches();


That should get tid of a taxonomy field called field_foo, and all associated index data.

Note this is for a core install - if you have other modules installed that rely on that field or taxonomy data in some way, things might not be so easy.