Re: [PERFORM] response time when querying via JDBC and via psql differs

2008-02-26 Thread valgog
Do not use setString() method to pass the parameter to the PreparedStatement in JDBC. Construct an SQL query string as you write it here and query the database with this new SQL string. This will make the planner to recreate a plan every time for every new SQL string per session (that is not usuall

Re: [PERFORM] response time when querying via JDBC and via psql differs

2008-02-25 Thread Nikolas Everett
The thing to remember here is that prepared statements are only planned once and strait queries are planned for each query. When you give the query planner some concrete input like in your example then it will happily use the index because it can check if the input starts with % or _. If you use

Re: [PERFORM] response time when querying via JDBC and via psql differs

2008-02-25 Thread Markus Bertheau
2008/2/25, Pavel Rotek <[EMAIL PROTECTED]>: > I have created functional index table(lower(href) varchar_pattern_ops) > because of lower case "like" searching. When i ask the database directly > from psql, it returns result in 0,5 ms, but when i put the same command via > jdbc driver, it returns i