Re: Poor performance with row wise comparisons

2025-10-17 Thread Peter Geoghegan
On Fri, Feb 7, 2025 at 2:05 AM Jon Emord wrote: > My expectation is that the following two queries would have roughly the same > performance. > They both use the same index only scans and return the same 100 rows of data. > The main difference I see in the explain output is that the row wise > c

Re: Poor performance with row wise comparisons

2025-10-17 Thread David G. Johnston
On Friday, October 10, 2025, wrote: > Looking for help on storing and retrieving the personal data as masked. > Any references and implementation details would help > Don’t reply to existing threads with unrelated stuff. Just send an email to begin your own thread. And choose an appropriate pl

Re: Poor performance with row wise comparisons

2025-10-11 Thread lokesh
Looking for help on storing and retrieving the personal data as masked. Any references and implementation details would help > On 10 Oct 2025, at 3:24 AM, Peter Geoghegan wrote: > > On Fri, Feb 7, 2025 at 2:05 AM Jon Emord wrote: >> My expectation is that the following two queries would have

Re: Poor performance with row wise comparisons

2025-02-10 Thread Laurenz Albe
On Fri, 2025-02-07 at 16:16 +, Jon Emord wrote: > explain (analyze, buffers) > select data_model_id, primary_key > from entity > WHERE (data_model_id, primary_key) BETWEEN (123, ‘ABC’) AND (123, ‘DEF’)  > limit 101; >                                                                              

Re: Poor performance with row wise comparisons

2025-02-09 Thread Tom Lane
Jon Emord writes: >-> Index Only Scan using entity_data_model_id_primary_key_uniq on entity > (cost=0.70..873753.60 rows=15581254 width=31) (actual time=0.093..2712.836 > rows=100 loops=1) > Index Cond: ((ROW(data_model_id, primary_key) >= ROW(123, > 'ABC'::text)) AND (ROW(data_m

Re: Poor performance with row wise comparisons

2025-02-09 Thread Jon Emord
From: Greg Sabino Mullane Sent: Friday, February 7, 2025 9:43 AM To: Jon Emord Cc: [email protected] Subject: Re: Poor performance with row wise comparisons You don't often get email from [email protected]. Learn why this is important<https://aka.ms/LearnAbou

Re: Poor performance with row wise comparisons

2025-02-07 Thread Greg Sabino Mullane
On Fri, Feb 7, 2025 at 2:05 AM Jon Emord wrote: > but with limit 101, the extra shared hits return > Can you show the explain analyze for the limit 101 case? Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support

Poor performance with row wise comparisons

2025-02-06 Thread Jon Emord
Hi everyone I wrote a query to iterate over two different columns. These columns have a composite unique index on them, and I’m only retrieving those columns. I found that there was a very large difference in performance when using row wise comparison versus a column comparison. The column comp