I am currently doing some hibernate performance test. My requirement is to search for data in a particular column of a table containing 8 million rows and 350 columns. Currently, I don't have the access to that database, however, the test database that I'm now using also contains 8millions+.
My question is, is there a significant difference in terms of scan speed when searching for a data in a table that containts 350 columns than in table containing 25 columns?
By the way, the way I check for data is :
sessionFactory.getCurrentSession().createSQLQuery("SELECT COL_5 from MY_TABLE where COL_5='" + theColValuePassedFromParameter+ "'").list();
Where in if the returned list is empty, the boolean method will return true, else false; I would also appreciate If someone can point me to a better, performant way of searching for a non-primary key data in hibernate.
Thanks in advance...