Is indexes are helpful on this query?

  • Select * from table_name

    I have a table which is heap and also no non-clustured indexes,

    When I Run the above query its taking approx. 2mins, no.of rows in this table are 27500

    Do Clustered or Non clustered helpful to speed up the query ?

    I cannot change the query...thats the requirement.

    Also tried select col1,col2,......from Table_name its taking the same time

    What we should if have to use this type of queries?

    Any Inputs are will be appreciated!

    [font="Tahoma"]
    --SQLFRNDZ[/url]
    [/font]

  • Nope. You're asking for every column, every row. That's a table scan, there's no faster way to fetch the entire table.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • That is what I expected too..but I was asked to tune this query .ha.haa.What to do ?

    [font="Tahoma"]
    --SQLFRNDZ[/url]
    [/font]

  • Nothing.

    Putting an appropriate clustered index in place instead of a heap might save a second or 2, maybe.

    Or you could request hardware upgrades. A faster network, more memory and better IO subsystem might help.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks

    [font="Tahoma"]
    --SQLFRNDZ[/url]
    [/font]

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply