pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
To: Andres Freund <andres@anarazel.de>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Cc: pgsql-hackers@postgresql.org, Anastasia Lubennikova <lubennikovaav@gmail.com>
Cc: Peter Geoghegan <pg@heroku.com>
Cc: David Steele <david@pgmasters.net>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Aleksander Alekseev <a.alekseev@postgrespro.ru>
Subject: Re: WIP: Covering + unique indexes.
Date: Fri, 31 Mar 2017 21:04:46 +0300
Message-ID: <bb4b24dd-eb80-97c8-5cb1-63dca80c8ec5@postgrespro.ru> (raw)
In-Reply-To: <20170331174728.4hpwklu46qwcrfwa@alap3.anarazel.de>
References: <56168952.4010101@postgrespro.ru>
	<46e1f13e-6887-3851-a525-f046029341eb@postgrespro.ru>
	<20170324124709.22419.51178.pgcf@coridan.postgresql.org>
	<c1f7c059-597f-44e8-7308-73d76ffd493c@sigaev.ru>
	<20170330191138.zawsxgsxnt2qy2as@alap3.anarazel.de>
	<a976fff4-29a9-c799-5c2d-19a371031325@postgrespro.ru>
	<20170331174728.4hpwklu46qwcrfwa@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

31.03.2017 20:47, Andres Freund:
>>> Maybe it would be better to modify index_form_tuple() to accept a new
>>> argument with a number of attributes, then you can just Assert that
>>> this number is never higher than the number of attributes in the
>>> TupleDesc.
>> Good point.
>> I agree that this function is a bit strange. I have to set
>> tupdesc->nattrs to support compatibility with index_form_tuple().
>> I didn't want to add neither a new field to tupledesc nor a new
>> parameter to index_form_tuple(), because they are used widely.
>>
>>
>> But I haven't considered the possibility of index_form_tuple() failure.
>> Fixed in this version of the patch. Now it creates a copy of tupledesc to
>> pass it to index_form_tuple.
> That seems like it'd actually be a noticeable increase in memory
> allocator overhead.  I think we should just add (as just proposed in
> separate thread), a _extended version of it that allows to specify the
> number of columns.

The function is called not that often. Only once per page split for 
indexes with included columns.
Doesn't look like dramatic overhead. So I decided that a wrapper 
function would be more appropriate than refactoring of all 
index_form_tuple() calls.
But index_form_tuple_extended() looks like a better solution.

-- 
Anastasia Lubennikova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

view thread (217+ messages)  latest in thread

Message-ID: <bb4b24dd-eb80-97c8-5cb1-63dca80c8ec5@postgrespro.ru>
Permalink:  ../bb4b24dd-eb80-97c8-5cb1-63dca80c8ec5@postgrespro.ru/
Also on:    postgresql.org/message-id/bb4b24dd-eb80-97c8-5cb1-63dca80c8ec5@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: a.lubennikova@postgrespro.ru, andres@anarazel.de, teodor@sigaev.ru, lubennikovaav@gmail.com, pg@heroku.com, david@pgmasters.net, peter.eisentraut@2ndquadrant.com, a.alekseev@postgrespro.ru
  Subject: Re: WIP: Covering + unique indexes.
  In-Reply-To: <bb4b24dd-eb80-97c8-5cb1-63dca80c8ec5@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox