optimisation query

  • hello Guys,

    I have a table that has about 64 million registered. When I did a select on the table I have a running time of 3:27 min. I want to know is that there is no way to optimize my request to reduce time..

    thank you in advance.

  • if you

    select * from MillionBillionRowTable

    That takes a lot of time.

    period.

    you are returning a ton of data, and that requires resources.

    the only way to speed that up is with hardware.(RAM, SSD's, Gigabit+ NIC.etc)

    you can help a little, by only selecting real data you need, to reduce the amount of data(but not the # of rows) like this:

    SELECT id,email from MillionBillionRowTable

    as a DBA, you can tune things with WHERE statements:

    select * from MillionBillionRowTable WHERE email = 'lowell@somedomain.com'

    that statement might be really slow, as it would be a table scan unless the column was already indexed.

    if i added an index on the email column, it would probably be faster...much faster and use anindex seek.

    '

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Read the execution plan to understand how the query optimizer chose to interpret your query.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 2 (of 2 total)

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