![]() ![]() Postgres=# explain select * from demotable order by num Postgres=# INSERT INTO demotable SELECT random() * 1000, generate_series(1, 10000) postgres=# CREATE TABLE demotable (num numeric, id int) In this case, Sort node can be on top of whole data retrieval including all other processing. The user scenario requires sorted data as output. Sorted data can be required explicitly or implicitly like below two cases: SortĪs the name suggests, this node is added as part of a plan tree whenever there is a need for sorted data. Let’s understand each one of these nodes. Some of the auxiliary nodes generated by the PostgreSQL query optimizer are as below: So here one auxiliary node “Sort” is added on top of the result of join to sort the data in the required order. ![]() Suppose a plan generated corresponding to the query as below: Sorting the data, aggregate of data, etc.Ĭonsider a simple query example such as… SELECT * FROM TBL1, TBL2 where TBL1.ID > TBL2.ID order by TBL.ID The nodes in this category are applied on top of data retrieved in order to further analyze or prepare report, etc e.g. The previous two kinds of nodes were related to how to fetch data from a base table and how to join data retrieved from two tables.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |