[HACKERS] New CORRESPONDING clause design

Поиск
Список
Период
Сортировка
От Surafel Temsgen
Тема [HACKERS] New CORRESPONDING clause design
Дата
Msg-id CALAY4q8XqRqAaNsdC2Om+r8dNEgZbaBHTQYT+8DL0BCRdo7H0w@mail.gmail.com
обсуждение исходный текст
Ответы Re: [HACKERS] New CORRESPONDING clause design  (Merlin Moncure <mmoncure@gmail.com>)
Re: [HACKERS] New CORRESPONDING clause design  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [HACKERS] New CORRESPONDING clause design  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
I am new here and I really want to contribute, I have read same resource that help understanding database system and postgresql. I would like to start implementing sql syntax corresponding by clause because I believe implementing sql syntax gives an opportunity to familiarize  many part of postgresql source code. Previous implementation is here and have an issue on explain query and break cases on unlabeled NULLs
To repeat what a corresponding by clause means
Corresponding clause either contains a BY(...) clause or not. If it
doesn't have a BY(...) clause the usage is as follows.
 
SELECT 1 a, 2 b, 3 c UNION CORRESPONDING SELECT 4 b, 5 d, 6 c, 7 f;
 
with output:
b c
-----
2 3
4 6
 
i.e. matching column names are filtered and are only output from the
whole set operation clause.
 
If we introduce a BY(...) clause, then column names are further
intersected with that BY clause:
 
SELECT 1 a, 2 b, 3 c UNION CORRESPONDING BY(b) SELECT 4 b, 5 d, 6 c, 7 f;
 
with output:
 
b
--
2
4
 My design is
 In parsing stage
1. Check at least one common column name appear in queries  
2. If corresponding column list is not specified, then make corresponding list from common column name in queries target lists in the order 
    that those column names appear in first query
3. If corresponding column list is specified, then check that every column name 
    in The corresponding column list appears in column names of both queries
    In planner
1. Take projection columen name from corresponding list
2. Reorder left and right queries target lists according to corresponding list
3. For each query, project columens as many as number of corresponding columen.
Continue with normal set operation process

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] pg_hba_file_settings view patch
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [HACKERS] Supporting huge pages on Windows