如果一个表有很多列,并且你查询许多不同的列组合,那么将不常用的数据拆分到每个只有几列的单独表中,并通过复制主表中的数字 ID 列与主表关联,可能会更加高效。这样,每个小表可以有一个主键以快速查找其数据,并且你可以使用连接操作只查询所需的列集合。根据数据的分布情况,这些查询可能会减少 I/O 并占用更少的缓存内存,因为相关列在磁盘上是连续存放的。(为了最大化性能,查询会尽量从磁盘读取尽可能少的数据块;只有少数几列的表可以在每个数据块中容纳更多的行。)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. 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. (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.)