PMSF
PMSF copied to clipboard
Fix Monocle/Alternative out of memory with KEEP_GYM_HISTORY
When KEEP_GYM_HISTORY
is on in Monocle/Alternative config, the fort_sighting
and raid
may contain multiple records of the same gym. Only the latest gym / fort status should be retrieved to avoid out of memory problem.
@CalamityJames fixed
Actually, the r.time_end >= :time
condition save time on both with history and no history case.
It's the condition on fs.last_modified
that may harm no history performance.
@j16sdiz I think you are right about r.time_end >= :time
Do you think you can add the config option for the other part? (Default for KEEP_GYM_HISTORY = false)
last_modified
and fort_id
are indexed.
I don't think this would impact the ones who don't use KEEP_GYMHISTORY
Can someone with KEEP_GYMHISTORY = False run a performance test on:
SELECT *
FROM forts f
LEFT JOIN fort_sightings fs ON (fs.fort_id = f.id AND fs.last_modified = (SELECT MAX(last_modified) FROM fort_sightings fs2 WHERE fs2.fort_id=f.id))
WHERE f.id = 1;
vs
SELECT *
FROM forts f
LEFT JOIN fort_sightings fs ON fs.fort_id = f.id
WHERE f.id = 1;
I did a test with f.id = 1...20 (uncached) on this and got the following result new avg: 0.071s old avg: 0.066s
@Glennmen fixed
@123FLO321 There is a 6% to 8% perfomance degrade. Personally I don't think this worth the extra code for a few milliseconds gain. But I respect the project owner.