優化sql查詢速度

xmh_sxh_1314發表於2020-10-25

在這裡插入圖片描述

1、建立索引

2、減少表之間的關聯

3、減少不必要的欄位,

4、優化sql,儘快定位到資料,不要做全表查詢

U2FsdGVkX18Stft6EWpLbM73rwG7GaJEuVsiewV1HiUBXmjmifREMG9lvU8g/Vqx
H1uDJ4TJzHQEETk7MxnC8pCHzMTQYi+k0Weo+VZu7jmC2G8oJB4u6YkctVRaTSMs
LHHIHe9Ek1uBf6nYt4xRUhpvRSyUK3Juwmeogikl3ER3H8dC4TbHGdZ07K/1YoXY
ysyF8uaoD1Jm+Ps9v0CSZXl9Jr5GOnfDLcFo64hzxkmvfw+nmJL1TCEueTzxLH+K
Mhex3vAd2F2l0W98GoZQ0x41RaMEXxFKJmeCse4FDp45ErdLxofoy3rR87qyIDbJ
sRf4NXpkc2dIA5zh/uwo4RGol2Fw43MkKDqy3JYj/jMdjbxoREMNdxV/CxWCLU26
d9hEwloONsTnBOBjZi6Qti6Z2PvNzJjqj5pfHUHU3oxK/tEEmEprRXxPJpKRZvtW
5ra5STdTKiWiN7J7vNNICLhOvpD0/UY2R4H2jic6EmOVq22DfHRWaCjYwntdCPRM
g8OVO5E1Ts7cQf9FvDPOg1e4G+yPAUIeVUOafwh16freoGWeTghQGEFD3QWyNMCk
LUiwvVKEV2L0G3LUaU4P73VJ2uwZzt+nz2LBwcyBapLHkqMoRkH84npG83/TavT5
EzgFlsdT7h12spZKTTlSGHZdcMeYC5nSmniSUMiYV5zvI0Br14Fi7Seqgy2prMav
Vzv5PK+V2nLzA28j0rQBM7G70U9FVw0RXS1N/YX5L0CrPKB7JVlRMMaJ4+f1V7DU
ZR4Se1mNIbUj6NHN4XOLiUvZjwIPxAiRVY+3/IB+/OsVyyYHl0FvKwnCVt1R3jv7
/5DWzrJkb0c8br+BhDc56HGkaee5dxqlPM3WYkywYK3cEy1lPrYnfMeby+3z2myW
WBcKLNkwsIB1dJqmJPieYKuMZM/EfnXw+vM35mjxBewh7iOT0K6I3ecydC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