mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-25 15:19:58 +00:00
## Problem See https://github.com/neondatabase/neon/issues/11718 GIST index can be constructed in two ways: GIST_SORTED_BUILD and GIST_BUFFERING. We used unlogged build in the second case but not in the first. ## Summary of changes Use unlogged build in `gist_indexsortbuild_flush_ready_pages` Correspondent Postgres PRsL: https://github.com/neondatabase/postgres/pull/624 https://github.com/neondatabase/postgres/pull/625 https://github.com/neondatabase/postgres/pull/626 --------- Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech> Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
29 lines
814 B
Python
29 lines
814 B
Python
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from fixtures.neon_fixtures import NeonEnv
|
|
|
|
|
|
#
|
|
# Test unlogged build for GIST index
|
|
#
|
|
def test_gist(neon_simple_env: NeonEnv):
|
|
env = neon_simple_env
|
|
endpoint = env.endpoints.create_start("main")
|
|
con = endpoint.connect()
|
|
cur = con.cursor()
|
|
iterations = 100
|
|
|
|
for _ in range(iterations):
|
|
cur.execute(
|
|
"CREATE TABLE pvactst (i INT, a INT[], p POINT) with (autovacuum_enabled = off)"
|
|
)
|
|
cur.execute(
|
|
"INSERT INTO pvactst SELECT i, array[1,2,3], point(i, i+1) FROM generate_series(1,1000) i"
|
|
)
|
|
cur.execute("CREATE INDEX gist_pvactst ON pvactst USING gist (p)")
|
|
cur.execute("VACUUM pvactst")
|
|
cur.execute("DROP TABLE pvactst")
|