8.3.4 Foreign Key Optimization外键优化

If a table has many columns, and you query many different combinations of columns, it might be efficient to split the less-frequently used data into separate tables with a few columns each, and relate them back to the main table by duplicating the numeric ID column from the main table. 如果一个表有许多列,并且您查询了许多不同的列组合,那么将不太常用的数据拆分为单独的表(每个表有几列)并通过从主表中复制数字ID列将它们关联回主表可能会很有效。That way, each small table can have a primary key for fast lookups of its data, and you can query just the set of columns that you need using a join operation. 这样,每个小表都可以有一个主键,用于快速查找其数据,并且可以使用联接操作查询所需的列集。Depending on how the data is distributed, the queries might perform less I/O and take up less cache memory because the relevant columns are packed together on disk. 根据数据的分布方式,查询可能会执行较少的I/O操作,占用较少的缓存内存,因为相关列在磁盘上打包在一起。(To maximize performance, queries try to read as few data blocks as possible from disk; tables with only a few columns can fit more rows in each data block.)(为了最大限度地提高性能,查询尝试从磁盘读取尽可能少的数据块;只有几列的表可以在每个数据块中容纳更多的行。)