| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
| Cc: | shihao zhong <zhong950419(at)gmail(dot)com>, Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Index drops during phase 1 of REINDEX CONCURRENTLY |
| Date: | 2026-11-20 04:47:17 |
| Message-ID: | av_Q1Zu6N63Be-9I@paquier.xyz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, Nov 16, 2026 at 12:04:32PM +0800, Chao Li wrote:
> Following Shihao’s comment, I swapped the order of the two CREATE
> INDEX statements:
> ```
> CREATE INDEX concur_reindex_ddl_ind2 ON
> concur_reindex_ddl_tab ((i + concur_reindex_ddl_im(0)));
> CREATE INDEX concur_reindex_ddl_ind1 ON concur_reindex_ddl_tab (i);
> ```
This shows your point, but it also impacts the test by not checking
anymore what I want it to test.
> The attached diff takes this approach and also swaps the order of
> the two CREATE INDEX statements in the test. The test passes with
> this change. Note that, the diff is based on v1.
Hmm, no, I think that you are overcomplicating things here by
introducing a second list that serves the same purpose as the "phase
1" list. It is simpler to keep the Relation references opened based
on the ones already taken in the first loop, and we are talking about
only two places.
Another redundant piece is the addition of the heap relation to the
new list until the session locks are hold. Perhaps nicer on
consistency grounds in the long-run, but not actually required so I
have kept the table_close() for it.
The original test ordering is kept. I have reused the solution where
the relations are kept opened in the initial loop, then committed the
change down to v15.
Thanks all for the reviews.
--
Michael
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bertrand Drouvot | 2026-11-20 05:00:51 | Re: EXPLAIN ANALYZE CREATE TABLE AS EXECUTE runs non-SELECT prepared statements |
| Previous Message | Sho Ito | 2026-11-20 04:41:09 | Re: [PATCH v1] Preserve implicit composite casts in ROW deparsing |