0

My question may sound childish, but I am really googling a lot regarding this issue. I have a table tblUsers where 20 columns are present (FirstName, LastName, EmailAddress....), which has around 91,000 data.

When I use Select Query

Select * from tblUsers

It takes around 2 min 27 seconds to complete execution.

Is It really any way to speed up the execution time

Any type of suggestions will be welcomed. Thanks in advance

  • 1
    can you add, DESC TABLE tlbUsers; in detail, also EXPLAIN SELECT * FROM tblUsers; for better results try adding where clause to query, simple select is going to take too long as all the records are fetched. – Priyanka Kariya Nov 24 '16 at 6:38
4

Is It really any way to speed up the execution time

You are running Select * from tblUsers and expecting it to be fast? You are selecting all columns and all rows from a table, so it will take its own time to return the result set. If there is a clustered index, an index scan would be used, and if the table is a heap, a table scan would be used.

If you want to increase the speed, you either have to add a WHERE clause to make query sargable or limit the number of columns, although the latter will not affect the execution time so much.

Also, if your data file lies on a fast storage (SSDs, Flash Drives, as compared to SATA disks), the query is likely to become faster.

Moral: If you are running select * on a table, don't expect the query to be fast, it would take its own time to retrieve all rows. If you are on a production system, running select * would really be a performance killer, so avoid it.

  • Sure, will keep in mind @Shanky – ispostback Nov 24 '16 at 7:01
1

I am not a Developer indeed but from my administration experience

My Suggestions would be :

  1. Review the Execution Plan
  2. Add Indexes
  3. Optimize Your SQL Structure and Joins
  4. Eliminate Unnecessary Data
  5. Analyze Your Server Specifications and Performance
  • My approach is pretty straight forward...can you give me an example@SQLBoy – ispostback Nov 24 '16 at 6:33
  • 1
    How would index help when you run select * on a table. – Shanky Nov 24 '16 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.