Re: Performance improvement for joins where outer side is unique

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Performance improvement for joins where outer side is unique
Дата
Msg-id CAApHDvokK_WnMQRkJfWzso922vrevriZbX55PtD_KEfSfSn-cw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Performance improvement for joins where outer side is unique  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
On 26 February 2015 at 13:15, Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:

BTW, I find this coding (first cast, then check) rather strange:

    Var *var = (Var *) ecm->em_expr;

    if (!IsA(var, Var))
        continue; /* Ignore Consts */

It's probably harmless, but I find it confusing and I can't remember
seeing it elsewhere in the code (for example clausesel.c and such) use
this style:

    ... clause is (Node*) ...

    if (IsA(clause, Var))
    {
        Var *var = (Var*)clause;
        ...
    }

or

    Var * var = NULL;

    if (! IsA(clause, Var))
        // error / continue

    var = (Var*)clause;


Yeah, it does look a bit weird, but if you search the code for "IsA(var, Var)" you'll see it's nothing new.

Regards

David Rowley
 

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Performance improvement for joins where outer side is unique
Следующее
От: David Rowley
Дата:
Сообщение: Re: Combining Aggregates