A simple query with where clause on 3 columns and having index on these 3 columns is taking approx 2 sec. The number of records in the table is around 8 million and the result is around 1000-4000 rows. No function used on the columns in the where clause. Same query runs in less than 100 milliseconds from db. We are using NamedParamterJDBCTemplate query method and this method is taking ~2sec
changed the order of index columns so that first column is such that most data gets filtered on that and so on.