Inlining the view

The first transformation done by the optimizer is to inline views. Here is what happens:

SELECT * FROM (   SELECT *    FROM a, b    WHERE aid = bid) AS v, c WHERE v.aid = c.cid       AND cid = 4;

The view is inlined and transformed to a subselect. What does this one buy us? Actually, nothing. All it does is to open the door for further optimization, which will really be a game changer for this query.

Get Mastering PostgreSQL 10 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.