Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
06-07-2011, 02:12 AM #1
- Join Date
- Jan 2010
- Birmingham, MI
- Thanked 9 Times in 9 Posts
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?
06-07-2011, 04:54 AM #2
- Join Date
- Mar 2006
- St. Catharines, Ontario Canada
- Thanked 147 Times in 138 Posts
5000 rows is insignificant. Run an EXPLAIN on your query to see what indexes, if any, are being used.