-1

I have a table with 2900000 records. Now I am using select query to find data and it will take 5 secs to fetch records. It's just select query and it will take 4-5 seconds to run it.

I dont know why it will take so much of time?

In the table, there are 4 fields which are varchar(Max). Is there any cause a problem?

Can anyone suggest me what to do to reduce the execution time?

AlexC
  • 10,676
  • 4
  • 37
  • 55
Brijesh Patel
  • 2,901
  • 15
  • 50
  • 73
  • 4
    maybe post your sql and table structure so we can look into it more – Greg Jul 19 '12 at 06:15
  • 1
    **What** database system, and which version?? *SQL* is just the *Structured Query Language* - a language used by many database systems, but not a a database product... we really need to know what **database system** you're using.... – marc_s Jul 19 '12 at 06:16
  • 1
    Please refer to number denominations in English. I have forgotten how much a laks is. – leppie Jul 19 '12 at 06:16
  • try to use indexing it will improve the performance.. – Ram Singh Jul 19 '12 at 06:21
  • ... and post your query plan if you are on SQLServer (or whatever is equivalent on another DBMS). – David Brabant Jul 19 '12 at 06:31

1 Answers1

0

You most likely need to add indexes to your table, for the columns which are used in the WHERE clause. Without knowing the specifics of your table schema, data and query (or rdbms flavor) it will be near impossible for anyone to help further.

I'm going to assume you're using SQL Server (because you didn't specify). If so, I'd suggest copying your query inside of SQL Management Studio, but pressing ctrl+m first (which will enable Actual Execution Plan to be shown) before execution. Now run the query, after it completes there will be a tab in the results area that will show suggested indexes (if any).

Please update your question with more specific details if possible.

mellodev
  • 1,597
  • 12
  • 20