Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2010
    Birmingham, MI
    Thanked 9 Times in 9 Posts

    Question Question About Views, Indexes and Query Logic

    So I just have a question about how I should be writing the query statement behind views. If I am writing a view, I was wondering if it makes any difference when performing an INNER JOIN if I join from the root tables containing the data, or from another view, that also has the data I am after.

    Sometimes it is more direct to just pull directly from another view, but from an efficiency standpoint, is it less efficient. I was just looking through my database status, and under "The number of joins that do not use indexes." I am not showing '8'. I don't think there were any yesterday, and I just wrote a view that utilizes another view. If this is my problem, how big of a problem is it, or how much will it affect query speed. The view could potentially become fairly large, easily greater than 5000 individual rows. Do I need to worry about how I have written the view?

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    St. Catharines, Ontario Canada
    Thanked 148 Times in 139 Posts
    5000 rows is insignificant. Run an EXPLAIN on your query to see what indexes, if any, are being used.


    Posting Permissions

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