Search Postgresql Archives

PrepareStatement and parameters data types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I was doing some experimenting to try and reduce the execution time of a query used in a PreparedStatement. To do that, I normally use the Prepare and Execute statements of Postgresql. What I notice is that explicit casting has a considerable performance impact. So using the good data types in the Prepare and avoid casting gives much better performance. My questions are :
The query is bit complex on large tables but the main part is : where cast($1 as text) is null or cast($2 as text) is null or ( date_field < cast(cast($3 as text) as date) and date_field > cast(cast($4 as text) as date) )

Thanks for your help.

Sabiq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux