Re: Question about MVCC caveats

2025-11-13 Thread Laurenz Albe
On Thu, 2025-11-13 at 13:30 -0600, Jim Nasby wrote: > At [1], the docs state that table rewrite ALTERs result in the relation > appearing > empty after the ALTER if another transaction had already taken a snapshot > before > the ALTER. A simple test with a repeatable read (or serializable) transa

Question about MVCC caveats

2025-11-13 Thread Jim Nasby
At [1], the docs state that table rewrite ALTERs result in the relation appearing empty after the ALTER if another transaction had already taken a snapshot before the ALTER. A simple test with a repeatable read (or serializable) transaction confirms this... but is there any other situation where a

Re: Forcing Index usage

2025-11-13 Thread pg254kl
Divide and conquer.  Get rid of the CTE temporarily. create temp table temp_search as ; -- index temp_search *appropriately* analyze temp_search; Use it instead of the CTE. Remove the ORDER BY temporarily. Work on putting the right indices in place to make the above run fast. I assume you h

Re: Forcing Index usage

2025-11-13 Thread Tom Lane
Greg Sabino Mullane writes: > Please provide a self-contained use case, or (at the bare minimum) trim out > the irrelevant parts of your query and show us the schema for the tables in > question. Finally, please show the explain plans for the "good" and "bad" > runs you are experiencing. Thanks.

Re: Forcing Index usage

2025-11-13 Thread Greg Sabino Mullane
Please provide a self-contained use case, or (at the bare minimum) trim out the irrelevant parts of your query and show us the schema for the tables in question. Finally, please show the explain plans for the "good" and "bad" runs you are experiencing. Thanks. Cheers, Greg -- Crunchy Data - http

Forcing Index usage

2025-11-13 Thread Zahir Lalani
Hello all Have a very frustrating issue - we are seeing the same results in our PG17 UAT and PG14 Live setups (we are in transition). (I can provide the query planner but not doing here in case its too much info) Here is the query in question which we have re-written to try and get better outc

Re: Is this expected concurrency behaviour for EvalPlanQual and ctid?

2025-11-13 Thread Bernice Southey
Here's a much simpler example. This one works when I turn off enable_tidscan, so I'm very hopeful Sophie's patch applies. It's very similar to the example bug, but loses an update instead of gaining one. It MSTM that both are because the ctid value wasn't being rechecked in EvalPlanQual. --session