Attack
Forum Üyesi
- Katılım
- 4 Şub 2023
- Mesajlar
- 2,618
- Puanları
- 0
getIpsByUser effectively uses the following query:
SQL:
SELECT ip, MIN(log_date) AS first_date, MAX(log_date) AS last_date, COUNT(*) AS totalFROM xf_ipWHERE user_id = ?GROUP BY ipORDER BY last_date DESCLIMIT 150;
Although it looks complicated, this can be optimized quite a bit by an index on (user_id, ip, log_date DESC). It's not a
SQL:
SELECT ip, MIN(log_date) AS first_date, MAX(log_date) AS last_date, COUNT(*) AS totalFROM xf_ipWHERE user_id = ?GROUP BY ipORDER BY last_date DESCLIMIT 150;
Although it looks complicated, this can be optimized quite a bit by an index on (user_id, ip, log_date DESC). It's not a
Misafirler için gizlenen link, görmek için
Giriş yap veya üye ol.
, but it should be good enough for all but the largest forums. Larger forums may be able to get better...
Misafirler için gizlenen link, görmek için
Giriş yap veya üye ol.