NP
Size: a a a
NP
TS
Ꮢ
TS
Ꮢ
MC
WITH car_subquery AS
(
SELECT number_of_owners, manufacture_year, number_of_doors
FROM car_portal_app.car
)
SELECT number_of_owners, number_of_doors FROM car_subquery
WHERE manufacture_year = 2008;
This has the opposite effect. PostgreSQL does not push the WHERE clause from the primary query to the sub-statement. The database will retrieve all the records from the table, take three columns from them, and store this temporary dataset in memory. Then, the temporary data will be queried using the manufacture_year = 2008 predicate. If there was an index on manufacture_year, it would not be used because the temporary data is being queried and not the real table.K
WITH car_subquery AS
(
SELECT number_of_owners, manufacture_year, number_of_doors
FROM car_portal_app.car
)
SELECT number_of_owners, number_of_doors FROM car_subquery
WHERE manufacture_year = 2008;
This has the opposite effect. PostgreSQL does not push the WHERE clause from the primary query to the sub-statement. The database will retrieve all the records from the table, take three columns from them, and store this temporary dataset in memory. Then, the temporary data will be queried using the manufacture_year = 2008 predicate. If there was an index on manufacture_year, it would not be used because the temporary data is being queried and not the real table.IK
WITH car_subquery AS
(
SELECT number_of_owners, manufacture_year, number_of_doors
FROM car_portal_app.car
)
SELECT number_of_owners, number_of_doors FROM car_subquery
WHERE manufacture_year = 2008;
This has the opposite effect. PostgreSQL does not push the WHERE clause from the primary query to the sub-statement. The database will retrieve all the records from the table, take three columns from them, and store this temporary dataset in memory. Then, the temporary data will be queried using the manufacture_year = 2008 predicate. If there was an index on manufacture_year, it would not be used because the temporary data is being queried and not the real table.MC
G
AC
Ꮢ
Ꮢ
IS