Fix slow queries in snapshot process
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 25 Jan 2023 21:25:28 +0000 (10:25 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 25 Jan 2023 21:27:45 +0000 (10:27 +1300)
commit91cbc857c1ef34e90265fce7d423074a193ffa11
tree274bc24695ee5a749573dc46058d7694451dbc7a
parent4502008c8e41b8b0935e00ebed0a0748e4095ced
Fix slow queries in snapshot process

SELECT COUNT(*) is slow to run on a large database but SELECT MAX(id) is
quick. The snapshot check only needs to be very rough - so MAX(id) should
be accurate enough.

This does make the message a little inaccurate - but my money says no-one
will notice & it's not worth creating work for the translators to change
CRM/Core/DAO.php
CRM/Upgrade/Snapshot.php