On Wed, Jun 25, 2025 at 3:10 PM Shlok Kyal <shlok.kyal....@gmail.com> wrote: > > > 4. Since we are not adding sequences in the list 'sub_remove_rels', > should we only palloc for (the count of no. of tables)? Is it worth > the effort? > /* > * Rels that we want to remove from subscription and drop any slots > * and origins corresponding to them. > */ > sub_remove_rels = palloc(subrel_count * sizeof(SubRemoveRels)); >
The sub_remove_rels array allocates memory for all relations in the subscription, even though it only uses entries for those that are actually removed. While this may result in unnecessary allocation, even when only tables are involved. OTOH, as it’s a short-lived variable, pre-allocating can help with performance. This requires further analysis, I plan to handle this in the next version. -- Thanks, Nisha