field_sql_storage_schema() exposes the schema of dynamic field data tables.

That's a *lot* of data in drupal_get_schema(), and computing it from configuration data on sites with lots of fields takes some CPU too.

Discussing with various people (@effulgentsia, @chx, @fago), it seems no-one sees the interest of exposing the schema for those tables. We don't ever use drupal_write_record() on those.

@DamZ pointed that ctools D7 uses the 'foreign keys' schema entries to auto-generate relationships - but it reads those from each individual field's hook_field_schema() rather than from drupal_schema()

Thoughts ?

#3 rm-field_sql_storage_schema-1957204-3.patch4.18 KByched
PASSED: [[SimpleTest]]: [MySQL] 55,757 pass(es). View
#3 interdiff.txt3 KByched
#1 rm-field_sql_storage_schema-1957204-1.patch915 bytesyched
FAILED: [[SimpleTest]]: [MySQL] 53,770 pass(es), 5 fail(s), and 1 exception(s). View


yched’s picture

Status: Active » Needs review
915 bytes
FAILED: [[SimpleTest]]: [MySQL] 53,770 pass(es), 5 fail(s), and 1 exception(s). View

Candidate patch, to get the ball rolling.

Status: Needs review » Needs work

The last submitted patch, rm-field_sql_storage_schema-1957204-1.patch, failed testing.

yched’s picture

Status: Needs work » Needs review
3 KB
4.18 KB
PASSED: [[SimpleTest]]: [MySQL] 55,757 pass(es). View

#1167144: Make cache backends responsible for their own storage has bitten the bullet and turned cache tables for SQL backends into field-like dynamic tables, that are not exposed in hook_schema(). So I guess it's open season :-)

Fixed the tests that relied on the schema.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Great idea.

yched’s picture

Issue tags: +Field API


catch’s picture

Status: Reviewed & tested by the community » Fixed

The only reason to have these in hook_schema() would be to compare them with schema module.

However if absolutely necessary schema module could add them back with hook_schema_alter() itself anyway, so I don't see the point.

This is going to make a big difference to the schema cache generation on misses, very nice.

Committed/pushed to 8.x, thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

remove cruft