The real SQL I want to execute is SELECT * FROM t WHERE col like 'abc%';
This query
probably can go with IndexScan since it is prefixed with 'abc'. However I
am confused when I want
to use PreparedStatement.
For example:
List<Map<String, Object>> imap = jdbcTemplate.queryForList("select *
from tm where a like ?",
new Object[] {"a" + "%"}
);
The parse tree is sent to postgreSQL is "a like ?", server knows nothing
about if it is prefixed with
something or not, so probably Index Scan can't be selected. So what the
user can use the prepared
Statement and use the IndexScan for the above case?
Thanks