DEV Community

Cover image for Ways of Seeing: ORMS & SQL Views

Ways of Seeing: ORMS & SQL Views

Anna Rankin on November 22, 2018

This article assumes a general understanding of how databases, Ruby, and Rails work - the examples below use the ActiveRecord library to map databa...
Collapse
 
jsutan profile image
jsutan

Was looking more for an interactive parser similar to the above that does a good job of breaking down each join and which ones stand out as larger problems from everything else (visually). Even with Query Plan Analyzer / DBMS_XPLAN it can get pretty hectic, especially when it starts introducing bitmap and hash joins, and if you have a lot of tables even the indented table tree view can be unwieldy after a certain depth.

Collapse
 
jsutan profile image
jsutan

Depesz's tool for explaining EXPLAIN output looks fantastic for PostgreSQL -- is there a similar tool for Oracle plans?

Collapse
 
rmoskal profile image
Robert Moskal • Edited

Good solution for when you are stuck with using an orm. But why not just make the sql query in-line and map the results set directly to json.Skip activerecord entirely.

Collapse
 
akiramakes profile image
Akira

Ah! This is cool!!