Improve automatic layer names from SQL queries.