>>> Tom Lane <tgl@sss.pgh.pa.us> wrote:
> [ a bit off-topic for the thread, but ... ]
>
> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
>> I'll attach the query and plan. You'll note that the query looks a
>> little odd, especially all the (1=1) tests.
>
> FWIW, it would be better to use "TRUE" as a placeholder in your
> generated queries. I don't suppose this would make a huge
percentage
> difference in such complicated queries, but in and of itself there
are
> a lot of cycles spent to parse "1=1" and then reduce it to constant
TRUE.
Thanks, I'll put in a request for enhancement for our framework.
(Not all databases we support handle boolean literals, so we need a
few lines in our plugin layer.)
In case anyone cares in terms of interpreting the timings I posted, on
the server where I just tested this change, the average plan time
dropped from 65.0 ms to 63.7 ms -- a 2% improvement. Eliminating
"pretty" whitespace shaved off another 0.2 ms, or 0.3%.
So, worth doing on our end as a tuning measure, but not a significant
distortion in terms of the issues discussed on the thread.
-Kevin