2, the query condition is the WHERE Name='captain'
3, the query condition is the WHERE Name='1'
1 representative is captain, 0 is not representative of captain
The query "captain" in Chinese will be much slower than the query '1'?
I have necessary raising such a field in the database used to as a query to use? Captain or query directly in Chinese?
CodePudding user response:
In theory, the captain or 1, it will not have the too big distinction on the query efficiency,Under normal circumstances, we will reduce the "captain", "vice captain", and "members" such as a dictionary of data, and carries on the management, and to use in other places is refer to the corresponding coding (or ID),
As for you want to add a special storage for 1 field, is technically possible (without considering whether reasonable),
Efficiency, storage, safety is the most basic database design, to consider problems, based on the personal advice you need to learn "database paradigm",
CodePudding user response:
The building Lord think too much, if change to number 1, 0 said the captain, the captain, is faster than using character (in the case of have the index also difference is very small), the same character, 'captain' and '1' search efficiency is the same (assuming that there is an index)