In order to decide whether a cache is supposed to be used for a lookup table PhpMaker is running a (very slow) COUNT() .
This COUNT() might lead to two errors:
- COUNT(*) on large tables might run into timeout on PHP
- COUNT(*) on MySQL views produces: ERROR 1140 (42000): Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
Instead of having a compatible SQL COUNT() for all database flavors, I suggest to have an individual counting as described in these MySQL examples:
SELECT COUNT(*) FROM (SELECT 1 FROM table_or_view LIMIT ${cache limit}+1) x;
Other database surely have a similar functionality (such as TOP in MS-SQL).
As I ran into error #2 my solution was to disabled the cache.