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

Commit6a431d5

Browse files
Andrey Kazarinovdanolivo
Andrey Kazarinov
authored andcommitted
Add function which shows memory usage.
function memctx_htab_sizes outputs allocated sizes and used sizes of aqo'smemory contexts and hash tablesa.lepikhov: I've changed implementation because the VIEW on memory contextsintroduced in the next version of core PostgreSQL.
1 parentc8b629c commit6a431d5

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

‎aqo--1.5--1.6.sql

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,17 @@ AS 'MODULE_PATHNAME', 'aqo_queries'
9898
LANGUAGE C STRICT VOLATILE PARALLEL SAFE;
9999

100100
CREATEVIEWaqo_queriesASSELECT*FROM aqo_queries();
101+
102+
-- Show how much shared memory AQO are using at the moment
103+
CREATEFUNCTIONaqo_memory_usage(
104+
OUT nametext,
105+
OUT allocated_sizeint,
106+
OUT used_sizeint
107+
)
108+
RETURNS SETOF record
109+
AS $$
110+
SELECT name, allocated_size, sizeFROM pg_shmem_allocations
111+
WHERE nameLIKE'AQO%';
112+
$$ LANGUAGE SQL;
113+
COMMENT ON FUNCTION aqo_memory_usage() IS
114+
'Show how much shared memory AQO are using at the moment';

‎t/001_pgbench.pl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@
159159
WHERE v.exec_time > 0.");
160160
is($res, 3);
161161

162+
$res =$node->safe_psql('postgres',"SELECT * FROM aqo_memory_usage() AS t1");
163+
note("MEMORY:\n$res\n");
164+
162165
# ##############################################################################
163166
#
164167
# pgbench on a database with AQO in 'learn' mode.
@@ -183,6 +186,9 @@
183186
"$TRANSACTIONS",'-c',"$CLIENTS",'-j',"$THREADS" ],
184187
'pgbench in frozen mode');
185188

189+
$res =$node->safe_psql('postgres',"SELECT * FROM aqo_memory_usage() AS t1");
190+
note("MEMORY:\n$res\n");
191+
186192
# ##############################################################################
187193
#
188194
# Check procedure of ML-knowledge data cleaning.
@@ -298,6 +304,9 @@
298304
is($new_stat_count ==$stat_count -$pgb_stat_count, 1,
299305
'Total number of samples in aqo_query_stat');
300306

307+
$res =$node->safe_psql('postgres',"SELECT * FROM aqo_memory_usage() AS t1");
308+
note("MEMORY:\n$res\n");
309+
301310
# ##############################################################################
302311
#
303312
# AQO works after moving to another schema

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp