Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdab4238

Browse files
committed
Add index information to /contrib/pgstattuple:
This is an extension of pgstattuple to query information from indexes.It supports btree, hash and gist. Gin is not supported. It scans onlyindex pages and does not read corresponding heap tuples. Therefore,'dead_tuple' means the number of tuples with LP_DELETE flag.Also, I added an experimental feature for btree indexes. It checksfragmentation factor of indexes. If an leaf has the right link on thenext adjacent page in the file, it is assumed to be continuous (notfragmented). It will help us to decide when to REINDEX.ITAGAKI Takahiro
1 parent591e90a commitdab4238

File tree

3 files changed

+430
-105
lines changed

3 files changed

+430
-105
lines changed

‎contrib/pgstattuple/README.pgstattuple

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ pgstattuple README2002/08/29 Tatsuo Ishii
22

33
1. What is pgstattuple?
44

5-
pgstattuple returns thetable length, percentage of the "dead"
6-
tuples of atable and other info. This may help users to determine
5+
pgstattuple returns therelation length, percentage of the "dead"
6+
tuples of arelation and other info. This may help users to determine
77
whether vacuum is necessary or not. Here is an example session:
88

99
test=# \x
@@ -23,7 +23,7 @@ free_percent | 1.95
2323

2424
Here are explanations for each column:
2525

26-
table_len-- physicaltable length in bytes
26+
table_len-- physicalrelation length in bytes
2727
tuple_count-- number of live tuples
2828
tuple_len-- total tuples length in bytes
2929
tuple_percent-- live tuples in %
@@ -40,7 +40,7 @@ free_percent-- free space in %
4040

4141
3. Using pgstattuple
4242

43-
pgstattuple may be called as atable function and is
43+
pgstattuple may be called as arelation function and is
4444
defined as follows:
4545

4646
CREATE OR REPLACE FUNCTION pgstattuple(text) RETURNS pgstattuple_type
@@ -51,14 +51,20 @@ free_percent-- free space in %
5151
AS 'MODULE_PATHNAME', 'pgstattuplebyid'
5252
LANGUAGE C STRICT;
5353

54-
The argument is thetable name (optionally it may be qualified)
55-
or the OID of thetable. Note that pgstattuple only returns
54+
The argument is therelation name (optionally it may be qualified)
55+
or the OID of therelation. Note that pgstattuple only returns
5656
one row.
5757

5858
4. Notes
5959

60-
pgstattuple acquires only a read lock on thetable. So concurrent
60+
pgstattuple acquires only a read lock on therelation. So concurrent
6161
update may affect the result.
6262

6363
pgstattuple judges a tuple is "dead" if HeapTupleSatisfiesNow()
6464
returns false.
65+
66+
5. History
67+
68+
2006/06/28
69+
70+
Extended to work against indexes.

‎contrib/pgstattuple/README.pgstattuple.euc_jp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
$PostgreSQL: pgsql/contrib/pgstattuple/README.pgstattuple.euc_jp,v 1.6 2006/02/27 16:09:49 petere Exp $
1+
$PostgreSQL: pgsql/contrib/pgstattuple/README.pgstattuple.euc_jp,v 1.7 2006/07/06 02:18:07 momjian Exp $
22

33
pgstattuple README2002/08/22 �а�ã��
44

55
1. pgstattuple�Ȥ�
66

7-
pgstattuple�ϡ�UPDATE��DELETE�Ǻ��줿�ơ��֥�Υ����ΰ���礭����
8-
ơ��֥뼫�Τ�ʪ��Ū���礭�����Ф���ѡ�����ơ������ֵѤ��ޤ�����
7+
pgstattuple�ϡ�UPDATE��DELETE�Ǻ��줿��졼�����Υ����ΰ���礭����
8+
�졼������Τ�ʪ��Ū���礭�����Ф���ѡ�����ơ������ֵѤ��ޤ�����
99
�ޤꡤ�ֵ��ͤ��礭����С�����������ߤ�¿���Τǡ�vacuum�򤫤���ɬ
1010
�פ�����Ȥ���Ƚ�Ǥν����ˤʤ�櫓�Ǥ�������ʳ��ˤ⤤�������ʾ���
1111
���֤�ޤ���
@@ -26,7 +26,7 @@ free_percent | 1.95
2626

2727
�ƹ��ܤ������Ǥ���
2828

29-
table_len-- �ơ��֥��ʪ��Ū���礭��(�Х���)
29+
table_len-- ��졼������ʪ��Ū���礭��(�Х���)
3030
tuple_count-- ���ץ��
3131
tuple_len-- ���ץ�Ĺ�ι��(�Х���)
3232
tuple_percent-- ���ץ�γ�硥table_len���Ф���tuple_len����Ψ��
@@ -56,12 +56,12 @@ free_percent--
5656
AS 'MODULE_PATHNAME', 'pgstattuple'
5757
LANGUAGE C STRICT;
5858

59-
������: �ơ��֥�̾
59+
������: ��졼�����̾
6060

6161
�ؿ�������pgstattuple_type���Ǥ���
6262

63-
pgstattuple�ϥơ��֥��AccessShareLock���������ʤ��Τǡ�
64-
pgstattuple ��¹���˳����ơ��֥�˹���������ȯ������ȡ�������
63+
pgstattuple�ϥ�졼������AccessShareLock���������ʤ��Τǡ�
64+
pgstattuple ��¹���˳�����졼�����˹���������ȯ������ȡ�������
6565
�ʤ���̤��֤���ǽ��������ޤ���
6666

6767
pgstattuple�����ץ��֥��ߡפ�Ƚ�Ǥ�����ϡ�
@@ -75,6 +75,10 @@ free_percent--
7575

7676
5. ��������
7777

78+
2006/06/28
79+
80+
����ǥå������Ф��Ƥ�ư���褦�˳�ĥ��
81+
7882
2002/09/04
7983

8084
SRF�ѹ���ȼ����Tom Lane���������󥿡��ե������ν�����Ԥä���

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp