Re: Small improvement to tlist_matches_tupdesc()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Small improvement to tlist_matches_tupdesc()
Date: 2015-10-29 03:27:49
Message-ID: 11156.1446089269@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> writes:
> I just found myself in execScan.c. I noticed that tlist_matches_tupdesc()
> is a bit wasteful in some cases as it goes to the trouble of matching the
> tlist to the TupleDesc item by item until it runs out of tlist items
> or finds a non-match. Once the loop completes it ensures that all tlist
> items were consumed, so basically in other words, it checks the lengths
> match.

> I think likely this was just not made optimal originally in d0b4399 when
> the length property etc were added to List

No, it's modeled after other places that allow for ignoring dropped
columns in one or both lists. While this code doesn't currently allow
that, the patch you suggest would prevent it from ever doing so (at least
not without reverting the patch first). I'd be okay with that if there
were evidence of a meaningful performance gain from it ... but you've
not provided any.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2015-10-29 03:37:48 Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')
Previous Message David Rowley 2015-10-29 03:16:28 Small improvement to tlist_matches_tupdesc()