Changing the SQL queries generated by views
"The next two options, Use aggregation and Query settings, are pretty complex and change the very heart of Views—the SQL queries it generates. As I've said before, Views is a report writer for Drupal. As Drupal allows structured data (thanks to fields), it stores its data in a database, and not all content management systems do this, you can take this data and use SQL queries to create the many different kinds of displays you've been building. And for most Views users, they will never need to know any SQL; Views will do it for you.
Of course, professional programmers scoff at the SQL queries generated by Views. It has to make a lot of assumptions, so it doesn't always generate the most efficient SQL queries ...
Get Mastering Drupal 8 Views now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.