Re: Declarative partitioning - Mailing list pgsql-hackers

From Amit Langote
Subject Re: Declarative partitioning
Date
Msg-id 573ACEB2.1090705@lab.ntt.co.jp
Whole thread Raw
In response to Re: Declarative partitioning  (Ildar Musin <i.musin@postgrespro.ru>)
Responses Re: Declarative partitioning  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi Ildar,

On 2016/05/16 22:12, Ildar Musin wrote:
> Hi Amit,
> 
> I'm running some experiments based on your infrastructure trying to
> optimize SELECT queries. At some point I need to get PartitionDesc for
> relation and to do it I'm using RelationGetPartitionDesc() function.
> Problem is that this function copies relcache data and it can be quite
> slow for large amounts (thousands) of partitions. The comment to the
> function says that we cannot use relation->rd_partdesc pointer to relcache
> because of possibility of relcache invalidation. Could you please tell is
> it possible that relcache invalidation occurs during SELECT/UPDATE/DELETE
> query?

Hmm, I think invalidation would not occur mid-query since it would have
acquired a lock on the table.  So the copying may be unnecessary though I
may be wrong.  I will study other similar code and see if that is so.

Thanks,
Amit





pgsql-hackers by date:

Previous
From: Rajkumar Raghuwanshi
Date:
Subject: Re: Postgres_fdw join pushdown - getting server crash in left outer join of three table
Next
From: Daniel Gustafsson
Date:
Subject: Bug in intarray bench script