On Tue, May 6, 2008 at 9:45 AM, Justin <justin@xxxxxxxxxxxxxxx> wrote: > This falls under the stupid question and i'm just curious what other people > think what makes a query complex? Well, as mentioned, there's two kinds. some that look big and ugly are actually just shovelling data with no fancy interactions between sets. Some reporting queries are like this. I've made simple reporting queries that took up many pages that were really simple in nature and fast on even older pgsql versions (7.2-7.4) I'd say that the use of correlated subqueries qualifies a query as complicated. Joining on non-usual pk-fk stuff. the more you're mashing one set of data against another, and the odder the way you have to do it, the more complex the query becomes.