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-06-17T04:28:58Z
Lists: pgsql-hackers
Attachments
- v6-0001-Teach-get_partition_for_tuple-to-cache-bound-offs.patch (application/octet-stream) patch v6-0001
On Wed, Jun 16, 2021 at 4:27 PM Amit Langote <amitlangote09@gmail.com> wrote: > On Mon, Jun 7, 2021 at 8:38 PM houzj.fnst@fujitsu.com > <houzj.fnst@fujitsu.com> wrote: > > The rough idea is to check the average batch number every 1000 rows. > > If the average batch num is greater than 1, then we enable the cache check, > > if not, disable cache check. This is similar to what 0d5f05cde0 did. > > Thanks for sharing the idea and writing a patch for it. > > I considered a simpler heuristic where we enable/disable caching of a > given offset if it is found by the binary search algorithm at least N > consecutive times. But your idea to check the ratio of the number of > tuples inserted over partition/bound offset changes every N tuples > inserted may be more adaptive. > > Please find attached a revised version of your patch, where I tried to > make it a bit easier to follow, hopefully. While doing so, I realized > that caching the bound offset across queries makes little sense now, > so I decided to keep the changes confined to execPartition.c. Do you > have a counter-argument to that? Attached a slightly revised version of that patch, with a commit message this time. -- 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