Querying the view

  • Dear All,

    I had created one view by joining 3 large tables with the group by class,

    while querying the view

    if i use select * from command , i got the result at 0 sec

    but if i use select top 1 * command it takes too much time

    why this take too much time?

  • could you show us your code please 🙂

    And perhaps the execution plan for both queries

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • Impossible to say without more information, but probably you're getting table scans.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

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

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