November 2019
Beginner to intermediate
470 pages
11h 59m
English
So far, you have seen what PostgreSQL can do for you and how the optimizer helps speed up queries. PostgreSQL is pretty smart, but it needs smart users. There are some cases in which the end user cripples the entire optimization process by doing stupid things. Let's drop the view by using the following command:
test=# DROP VIEW v; DROP VIEW
Now, the view has been recreated. Note that OFFSET 0 has been added to the end of the view. Let's take a look at the following example:
test=# CREATE VIEW v AS SELECT * FROM a, b WHERE aid = bid OFFSET 0;CREATE VIEW
While this view is logically equivalent to the example that was shown previously, the optimizer has to treat things differently. Every OFFSET other than 0 will change ...
Read now
Unlock full access