mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-04 20:12:54 +00:00
This will help to keep us from using deprecated Python features going forward. Signed-off-by: Tristan Partin <tristan@neon.tech>
34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
from contextlib import closing
|
|
|
|
from fixtures.compare_fixtures import PgCompare
|
|
|
|
|
|
#
|
|
# Test buffering GisT build. It WAL-logs the whole relation, in 32-page chunks.
|
|
# As of this writing, we're duplicate those giant WAL records for each page,
|
|
# which makes the delta layer about 32x larger than it needs to be.
|
|
#
|
|
def test_gist_buffering_build(neon_with_baseline: PgCompare):
|
|
env = neon_with_baseline
|
|
|
|
with closing(env.pg.connect()) as conn:
|
|
with conn.cursor() as cur:
|
|
# Create test table.
|
|
cur.execute("create table gist_point_tbl(id int4, p point)")
|
|
cur.execute(
|
|
"insert into gist_point_tbl select g, point(g, g) from generate_series(1, 1000000) g;"
|
|
)
|
|
|
|
# Build the index.
|
|
with env.record_pageserver_writes("pageserver_writes"):
|
|
with env.record_duration("build"):
|
|
cur.execute(
|
|
"create index gist_pointidx2 on gist_point_tbl using gist(p) with (buffering = on)"
|
|
)
|
|
env.flush()
|
|
|
|
env.report_peak_memory_use()
|
|
env.report_size()
|