I find query layers are a bit fiddly to set up. They take just a little bit longer to create than I'd like, so I don't use them as often as I should.
Believe it or not, creating a database view using a SQL client is often faster:
create or replace view ad_hoc_vw as select * from roads where ...
It seems kind of backwards to create database views for ad-hoc analysis. That's where query layers ought to come in, since they're temporary in the map, not persistent in the database like views.
Part of the problem is that we need to connect to the database in question when creating the query layer. That takes ~20 seconds, which is an eternity when you're in a hurry.
Could the Create Query Layer window be changed so that it re-uses existing database connections that are already connected in Catalog? In other words, why do we need to re-connect when there is already an open connection?
Is there anything else that can be done to make creating a query layer easier/more streamlined, to facilitate fast-paced ad-hoc analysis?
Related: Virtual Attribute Fields (ad hoc)