Reduce database pause for initial search table scan: Bug #725929
Reduce database pause for initial search table scan: Bug #725929

SELECT within a SELECT can be deadly with SQLite and we've coded them
out of other places to improve database performance.  The initial
search table scan at startup also used a SELECT within a SELECT, and
so refactoring it to manually perform the UNION operation improves
performance.  The normal case (no rows must be indexed) is completed
almost instantaneously now.

robol/geary,glebihan/geary,jimbonator/geary,martinra/geary,glebihan/geary,githubnemo/geary,aatishnn/geary,emersion/geary,emersion/geary,AtticHacker/geary,githubnemo/geary,glebihan/geary,tshikaboom/geary,robol/geary,githubnemo/geary,AtticHacker/geary,mjog/geary,mjog/geary,jimbonator/geary,robol/geary,tshikaboom/geary,martinra/geary,aatishnn/geary,mjog/geary,AtticHacker/geary,tshikaboom/geary,jimbonator/geary,emersion/geary,aatishnn/geary,martinra/geary