Fixed a worst-case for SQL trusted analysis