Re: How to improve the performance of my SQL query?

2023-07-23 Thread Laurenz Albe
On Fri, 2023-07-21 at 09:43 +0800, gzh wrote: > The definitions of the columns used in SQL are as follows. > > TBL_SHA > > ms_cd character(6) NOT NULL       -- PRIMARY KEY > et_cd character(8) > etrys character(8) > > TBL_INF > > ms_cd character(6) NOT NULL       -- PRIMARY KEY > ry_cd characte

Re: pageinspect bt_page_items doc

2023-07-23 Thread Julien Rouhaud
Hi, On Mon, Jul 24, 2023 at 08:57:05AM +0800, jian he wrote: > hi. > > https://www.postgresql.org/docs/current/pageinspect.html#id-1.11.7.34.6 > > > This is a B-tree leaf page. All tuples that point to the table happen to be > > posting list tuples (all of which store a total of 100 6 byte TIDs).

pageinspect bt_page_items doc

2023-07-23 Thread jian he
hi. https://www.postgresql.org/docs/current/pageinspect.html#id-1.11.7.34.6 > This is a B-tree leaf page. All tuples that point to the table happen to be > posting list tuples (all of which store a total of 100 6 byte TIDs). > There is also a “high key” tuple at itemoffset number 1. ctid is used

Re: Effects of dropping a large table

2023-07-23 Thread Ron
On 7/23/23 05:27, Peter J. Holzer wrote: On 2023-07-23 06:09:03 -0400, Gus Spier wrote: Ah! Truncating a table does not entail all of WAL processes. From the documentation, "TRUNCATE quickly removes all rows from a set of tables. It has the same effect as an unqualified DELETE on each table, but

Re: Effects of dropping a large table

2023-07-23 Thread Peter J. Holzer
On 2023-07-23 06:09:03 -0400, Gus Spier wrote: > Ah! Truncating a table does not entail all of WAL processes. From the > documentation, "TRUNCATE quickly removes all rows from a set of tables. It has > the same effect as an unqualified DELETE on each table, but since it does not > actually scan the

Re: Effects of dropping a large table

2023-07-23 Thread Gus Spier
Ah! Truncating a table does not entail all of WAL processes. From the documentation, "TRUNCATE quickly removes all rows from a set of tables. It has the same effect as an unqualified DELETE on each table, but since it does not actually scan the tables it is faster. Furthermore, it reclaims disk spa

Re: Effects of dropping a large table

2023-07-23 Thread Peter J. Holzer
On 2023-07-22 16:37:39 -0400, Gus Spier wrote: > Isn’t this a perfect opportunity to use the TRUNCATE command to > quickly remove the data? And follow up by deleting the now empty > tables? What's the advantage of first truncating and then deleting a table over just deleting it? hp --