For unique IDs or other values that can be represented as either strings or numbers, prefer numeric columns to string columns. 对于可以表示为字符串或数字的唯一ID或其他值,首选数字列而不是字符串列。Since large numeric values can be stored in fewer bytes than the corresponding strings, it is faster and takes less memory to transfer and compare them.由于与相应字符串相比,大数值可以存储在更少的字节中,因此传输和比较它们的速度更快,占用的内存更少。
If you are using numeric data, it is faster in many cases to access information from a database (using a live connection) than to access a text file. 如果您使用的是数字数据,在许多情况下,从数据库访问信息(使用实时连接)比访问文本文件要快。Information in the database is likely to be stored in a more compact format than in the text file, so accessing it involves fewer disk accesses. 数据库中的信息可能以比文本文件更紧凑的格式存储,因此访问它需要更少的磁盘访问。You also save code in your application because you can avoid parsing the text file to find line and column boundaries.您还可以在应用程序中保存代码,因为这样可以避免解析文本文件以查找行和列边界。