Which query is faster for MYSQL? First, Table 1: primary key is A (20-bit bigint type), and field B is A string (the auto-increment ID of table 2, multiple separate) Table 2: Record 2: record table, field A auto-incrementing, field B is (20-bit bigint type, repeatable, add index) assume that the data is large, to get a 20-bit bigin MYSQL, which query is faster?
First:
Table 1: primary key is A (20-bit bigint type), and field B is A string (the auto-increment ID of table 2, separated)
Table 2: Records
Second:
Record table, field A auto-increment, field B is (20-bit bigint type, repeatable, add index)
If the data is large, which design queries are fast in order to get a 20-bit bigint data list?
------ Solution --------------------
Reference:
Reference: 20-bit bigint. is it necessary to be so big? Be careful with 64bit Integer events.
What events? I have never heard of it. please explain it.
Converts a string to a BIGINT type.
$ Large_number = 922337203685477580800;
Echo $ large_number; // 9.2233720109548e + 20
Is it really necessary to generate so many digits?
------ Solution --------------------
The upstairs are all broken...
For your problem: the second
------ Solution --------------------
Of course it's the second type!
Although mysql provides the find_in_set function to easily lift members from Comma-separated strings, it takes some time to execute the function.
How can it be faster than direct reading?