Improve performance of the record table assert.

@zhen-wang-zocdoc Old query was making a lot of reads from the information_schema.  This query is equivalent and cheaper.