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

Commit91f1fe9

Browse files
committed
pg_buffercache: Change page_num type to bigint
The page_num was defined as integer, which should be sufficient for thenear future (with 4K pages it's 8TB). But it's virtually free to returnbigint, and get a wider range. This was agreed on the thread, but Iforgot to tweak this inba2a3c2.While at it, make the data types in CREATE VIEW a bit more consistent.Discussion:https://postgr.es/m/CAKZiRmxh6KWo0aqRqvmcoaX2jUxZYb4kGp3N%3Dq1w%2BDiH-696Xw%40mail.gmail.co
1 parentb8a6078 commit91f1fe9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

‎contrib/pg_buffercache/pg_buffercache--1.5--1.6.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LANGUAGE C PARALLEL SAFE;
1212
-- Create a view for convenient access.
1313
CREATEVIEWpg_buffercache_numaAS
1414
SELECT P.*FROM pg_buffercache_numa_pages()AS P
15-
(bufferidinteger, os_page_numint4, numa_nodeint4);
15+
(bufferidinteger, os_page_numbigint, numa_nodeinteger);
1616

1717
-- Don't want these to be available to public.
1818
REVOKE ALLON FUNCTION pg_buffercache_numa_pages()FROM PUBLIC;

‎contrib/pg_buffercache/pg_buffercache_pages.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ typedef struct
7272
typedefstruct
7373
{
7474
uint32bufferid;
75-
int32page_num;
75+
int64page_num;
7676
int32numa_node;
7777
}BufferCacheNumaRec;
7878

@@ -414,7 +414,7 @@ pg_buffercache_numa_pages(PG_FUNCTION_ARGS)
414414
TupleDescInitEntry(tupledesc, (AttrNumber)1,"bufferid",
415415
INT4OID,-1,0);
416416
TupleDescInitEntry(tupledesc, (AttrNumber)2,"os_page_num",
417-
INT4OID,-1,0);
417+
INT8OID,-1,0);
418418
TupleDescInitEntry(tupledesc, (AttrNumber)3,"numa_node",
419419
INT4OID,-1,0);
420420

@@ -522,7 +522,7 @@ pg_buffercache_numa_pages(PG_FUNCTION_ARGS)
522522
values[0]=Int32GetDatum(fctx->record[i].bufferid);
523523
nulls[0]= false;
524524

525-
values[1]=Int32GetDatum(fctx->record[i].page_num);
525+
values[1]=Int64GetDatum(fctx->record[i].page_num);
526526
nulls[1]= false;
527527

528528
values[2]=Int32GetDatum(fctx->record[i].numa_node);

‎doc/src/sgml/pgbuffercache.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267

268268
<row>
269269
<entry role="catalog_table_entry"><para role="column_definition">
270-
<structfield>os_page_num</structfield> <type>int</type>
270+
<structfield>os_page_num</structfield> <type>bigint</type>
271271
</para>
272272
<para>
273273
number of OS memory page for this buffer

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp