Re: Skip partition tuple routing with constant partition key
Amit Langote <amitlangote09@gmail.com>
From: Amit Langote <amitlangote09@gmail.com>
To: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
Cc: David Rowley <dgrowleyml@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Date: 2021-05-27T08:46:00Z
Lists: pgsql-hackers
Hou-san, On Thu, May 27, 2021 at 3:56 PM houzj.fnst@fujitsu.com <houzj.fnst@fujitsu.com> wrote: > From: Amit Langote <amitlangote09@gmail.com> > Sent: Thursday, May 27, 2021 1:54 PM > > On Thu, May 27, 2021 at 11:47 AM houzj.fnst@fujitsu.com > > <houzj.fnst@fujitsu.com> wrote: > > > About teaching relcache about caching the target partition. > > > > > > David-san suggested cache the partidx in PartitionDesc. > > > And it will need looping and checking the cached value at each level. > > > I was thinking can we cache a partidx list[1, 2 ,3], and then we can > > > follow the list to get the last partition and do the partition CHECK > > > only for the last partition. If any unexpected thing happen, we can > > > return to the original table and redo the tuple routing without using the > > cached index. > > > What do you think ? > > > > Where are you thinking to cache the partidx list? Inside PartitionDesc or some > > executor struct? > > I was thinking cache the partidx list in PartitionDescData which is in relcache, if possible, we can > use the cached partition between statements. Ah, okay. I thought you were talking about a different idea. How and where would you determine that a cached partidx value is indeed the correct one for a given row? Anyway, do you want to try writing a patch to see how it might work? -- Amit Langote EDB: http://www.enterprisedb.com
Commits
-
Have ExecFindPartition cache the last found partition
- 3592e0ff98b1 16.0 landed
-
Fix publish_as_relid with multiple publications
- c91f71b9dc91 15.0 cited