As identified in the file at the provided location, the query is "simply" trying to determine the existence of any record in the table. The particular field returned is a key of the table but is not the primary key. My suggestion was to change the query to use the primary key.
The idea is that even when the table is large as soon as a record is found it should stop looking. Further if there are no records in the table, then it should be that much faster (one less record to evaluate).
Now if you have gone and done some form of database optimization that has affected table characteristics, that too could explain the issue.
To be honest right now I would be trying to evaluate if the existing method is considered the most efficient/fastest way to accomplish the described task.
If you find a faster method, you can always contribute at
https://github.com/zencart/zencart. The code maintainers are always looking for ways to micro optimize operations.
Bookmarks