1

I have a very long query in MySQL (MariaDB) which runs multiple JOIN and LEFT JOIN to 5 or more tables (InnoDB). Is it better to convert this to a view instead?

enchance
  • 29,075
  • 35
  • 87
  • 127
  • From my experience views are never faster, but may kill the performance when the result needs to be filtered. However i would just test both ways. – Paul Spiegel Dec 31 '16 at 13:49

1 Answers1

0

A view is just a stored SQL, nothing more. It is going to be executed in the exact same way. It can, however, be convenient to be able to query one single object instead of writing messy join everywhere.

Views are an organizational tool, not a performance enhancement tool.


Also See:

Community
  • 1
  • 1
Gurwinder Singh
  • 38,557
  • 6
  • 51
  • 76