Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2009
    Posts
    3

    Unanswered: Create view & query on the view is slow?

    Hello all,

    I have 2 tables: Post & PostMetas

    http://www.up2store.com/resources/up/1.png

    Data of Posts table:

    http://www.up2store.com/resources/up/2.png

    Data of PostMetas table:

    http://www.up2store.com/resources/up/3.png

    I'm create a view, with SQL:

    http://www.up2store.com/resources/up/5.png

    ..and have a view in below:

    http://www.up2store.com/resources/up/4.png

    I have a question:

    When data to big, query on the view is slow?

  2. #2
    Join Date
    Aug 2006
    Posts
    16
    Just checked the view definition. you are using this table thrice while this can be achived with a single inner join.
    Views are always slow reason being it's one more obsticle between sql server and tables.

    Hope answered your question

  3. #3
    Join Date
    Mar 2009
    Posts
    3
    Quote Originally Posted by greenindia
    Just checked the view definition. you are using this table thrice while this can be achived with a single inner join.
    Views are always slow reason being it's one more obsticle between sql server and tables.

    Hope answered your question
    Thanks for reply,

    I think not use view for large data, it's ok?

  4. #4
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Quote Originally Posted by greenindia
    Views are always slow
    Ouch. Is that really true for SQL Server?
    I never really liked SQL Server, but if views are really slower than the corresponding SELECT statement on SQL Server, it's just another reason for not liking it...

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by shammat
    Is that really true for SQL Server?
    please don't be so nave

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Quote Originally Posted by r937
    please don't be so nave
    I'm not naive, this was an honest question.

    I don't have too much experience with SQL Server, so if someone tells me views are slower than regular SQL statements, I need to ask if this is really true.

    I can't really believe it, but then who knows. Microsoft has done strange things before
    And of course I'd like to see a proof for it as well if the poster claims that views are really slower than regular statements

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •