Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am facing a problem with a simple query which is taking lot of time. I have a table with Dummy_Table with coumns A, B, C etc upto 15 columns.

I have a simple query which goes like this.
select count(*) from Dummy_Table where A = 'bdfb' and B = 'gg' and Z = 'ggdg' and P = 'nmlk' and S = 'giuh'

This Dummy_Table has got about 30 million records.
The above query is taking about 30 secs to execute. My target is to bring it down to less than 1 sec.

I tried setting the proper indexes, keeping the order of Index and where clause as same but I am unable to get the required result.

I would request anyone in this forum to suggest me an appropriate solution. I also heard that we can improve the performance by using Hashing functions. Can anyone help me regarding how we can do that.

Thanks in advance.
Posted
Updated 17-May-11 18:36pm
v2

1 solution

You can try using temp tables - but really, bringing 30 secs down to 1 is too steep a requirement IMO.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900