I haven’t finished writing this article, so please don’t read it next time, it’s too messy
Horizontal split: too much data in the table, split into multiple tables, the structure of each table is the same
Vertical split: there are too many attributes in the table, split, the structure of each table is different, but there is at least one common attribute, generally the primary key
Disk (binary data)--"Memory--"Read
Do not read the contents of the hard disk
- Generate static files
- Memory as cache data
- Use the cache database Redis
Caching: Reduce the read time of the physical disk
The cache and the database are not synchronized. The content of data saved in Redis is often not displayed, and its content is statistics of some high-concurrency data information
JDBC function
- Establish a connection to the database
- Initiate a query request to the database
- Process data and return results
In the database, you should try to avoid using or in the where clause as the connection condition, otherwise it will cause the engine to give up using the index and perform a full table scan, so use union/union all. Union will automatically compress multiple results (duplicate), while union all will display all the results. Regardless of whether it is repeated or not, because the union needs to perform repeated value scanning, the efficiency is low.
Use between and and keywords in the select statement is a closed interval