Re: Don't overwrite scan key in systable_beginscan()

2024-12-03 Thread Peter Eisentraut
On 27.11.24 16:35, Justin Pryzby wrote: On Wed, Nov 27, 2024 at 04:33:25PM +0100, Peter Eisentraut wrote: On 26.11.24 14:56, Justin Pryzby wrote: Since 811af9786b, the palloc'd idxkey's seem to be leaking/accumulating throughout the command. I noticed this on the master branch while running AN

Re: Don't overwrite scan key in systable_beginscan()

2024-11-27 Thread Justin Pryzby
On Wed, Nov 27, 2024 at 04:33:25PM +0100, Peter Eisentraut wrote: > On 26.11.24 14:56, Justin Pryzby wrote: > > Since 811af9786b, the palloc'd idxkey's seem to be leaking/accumulating > > throughout the command. > > > > I noticed this on the master branch while running ANALYZE on partitioned > > t

Re: Don't overwrite scan key in systable_beginscan()

2024-11-27 Thread Peter Eisentraut
On 26.11.24 14:56, Justin Pryzby wrote: Since 811af9786b, the palloc'd idxkey's seem to be leaking/accumulating throughout the command. I noticed this on the master branch while running ANALYZE on partitioned table with 600 attributes, even though only 6 were being analyzed. LOG: level: 3; Bui

Re: Don't overwrite scan key in systable_beginscan()

2024-11-26 Thread Justin Pryzby
On Mon, Aug 12, 2024 at 09:44:02AM +0200, Peter Eisentraut wrote: > Second (or 0005), an alternative to palloc is to make the converted scan > keys a normal local variable. Then it's just a question of whether a > smaller palloc is preferred over an over-allocated local variable. I think > I stil

Re: Don't overwrite scan key in systable_beginscan()

2024-09-05 Thread Peter Eisentraut
On 12.08.24 09:44, Peter Eisentraut wrote: On 09.08.24 06:55, Tom Lane wrote: Noah Misch writes: On Thu, Aug 08, 2024 at 08:46:35AM +0200, Peter Eisentraut wrote: I propose to fix that by making a copy of the scan keys passed by the caller and make the modifications there. No objection, bu

Re: Don't overwrite scan key in systable_beginscan()

2024-08-12 Thread Peter Eisentraut
On 09.08.24 06:55, Tom Lane wrote: Noah Misch writes: On Thu, Aug 08, 2024 at 08:46:35AM +0200, Peter Eisentraut wrote: I propose to fix that by making a copy of the scan keys passed by the caller and make the modifications there. No objection, but this would obsolete at least some of these

Re: Don't overwrite scan key in systable_beginscan()

2024-08-08 Thread Tom Lane
Noah Misch writes: > On Thu, Aug 08, 2024 at 08:46:35AM +0200, Peter Eisentraut wrote: >> I propose to fix that by making a copy of the scan keys passed by the caller >> and make the modifications there. > No objection, but this would obsolete at least some of these comments (the > catcache.c one

Re: Don't overwrite scan key in systable_beginscan()

2024-08-08 Thread Noah Misch
On Thu, Aug 08, 2024 at 08:46:35AM +0200, Peter Eisentraut wrote: > When systable_beginscan() and systable_beginscan_ordered() choose an index > scan, they remap the attribute numbers in the passed-in scan keys to the > attribute numbers of the index, and then write those remapped attribute > numbe

Re: Don't overwrite scan key in systable_beginscan()

2024-08-08 Thread Tom Lane
Robert Haas writes: > On Thu, Aug 8, 2024 at 2:46 AM Peter Eisentraut wrote: >> I propose to fix that by making a copy of the scan keys passed by the >> caller and make the modifications there. > This does have the disadvantage of adding more palloc overhead. It seems hard to believe that one m

Re: Don't overwrite scan key in systable_beginscan()

2024-08-08 Thread Robert Haas
On Thu, Aug 8, 2024 at 2:46 AM Peter Eisentraut wrote: > When systable_beginscan() and systable_beginscan_ordered() choose an > index scan, they remap the attribute numbers in the passed-in scan keys > to the attribute numbers of the index, and then write those remapped > attribute numbers back in