Re: Performance improvement for joins where outer side is unique

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Performance improvement for joins where outer side is unique
Date: 2015-03-04 09:04:03
Message-ID: CAApHDvokK_WnMQRkJfWzso922vrevriZbX55PtD_KEfSfSn-cw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 26 February 2015 at 13:15, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2015-03-04 09:23:29 Re: Combining Aggregates
Previous Message David Rowley 2015-03-04 09:00:31 Re: Performance improvement for joins where outer side is unique