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

[PGPRO-11556] Stabilize array test.#135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sokolcati merged 2 commits intopostgrespro:masterfromGreen-Chan:PGPRO-11556
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
[PGPRO-11556] Fixes after review
  • Loading branch information
Karina Litskevich committedNov 26, 2024
commitab2b0b5ae3a02fe932149b2db7b7be3e49d9b37c
25 changes: 13 additions & 12 deletionsexpected/array.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -854,27 +854,28 @@ DROP INDEX idx_array;
/*
* Check ordering using distance operator
*
* The idea of the test:
* We want to check that index scan provides as correct ordering by distance
* We want to check that index scan provides us correct ordering by distance
* operator. File 'data/rum_array.data' contains two arrays that statisfy
* i @> '{23,20}' and have finite distance i <=> '{51}', and a bunch of arrays
* that statisfy i @> '{23,20}' and have infinite distance i <=> '{51}'. When
* ordering by distance the order of this bunch of arrays with infinite
* that statisfy i @> '{23,20}' and have infinite distance i <=> '{51}'.
*
* When ordering by distance the order of this bunch of arrays with infinite
* distance is not determined and may depend of PostgreSQL version and system.
* Adding another sort expression to ORDER BY may cause another plan that
* doesn't use ordering provided by index.
* That's why we use the query you see below. We substitute 'Infinity' distance
* value with -1 because 'Infinity' are printed differently in output in
* different PostgreSQL versions. We substitute arrays that have infinite
* distance with {-1} because their order is undefined and we wnat to determine
* the test output.
* We don't add another sort expression to ORDER BY because that might cause
* the planner to avoid using the index. Instead, we replace arrays that have
* infinite distance with {-1} to unambiguously determine the test output.
*
* 'Infinity' is printed differently in the output in different PostgreSQL
* versions, so we replace it with -1.
*/
CREATE TABLE test_array_order (
i int2[]
);
\copy test_array_order(i) from 'data/rum_array.data';
CREATE INDEX idx_array_order ON test_array_order USING rum (i rum_anyarray_ops);
/* Check that plan of the query uses ordering provided by index scan */
/*
* Check that plan of the query uses ordering provided by index scan
*/
EXPLAIN (COSTS OFF)
SELECT
CASE WHEN distance = 'Infinity' THEN '{-1}'
Expand Down
25 changes: 13 additions & 12 deletionsexpected/array_1.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -847,27 +847,28 @@ DROP INDEX idx_array;
/*
* Check ordering using distance operator
*
* The idea of the test:
* We want to check that index scan provides as correct ordering by distance
* We want to check that index scan provides us correct ordering by distance
* operator. File 'data/rum_array.data' contains two arrays that statisfy
* i @> '{23,20}' and have finite distance i <=> '{51}', and a bunch of arrays
* that statisfy i @> '{23,20}' and have infinite distance i <=> '{51}'. When
* ordering by distance the order of this bunch of arrays with infinite
* that statisfy i @> '{23,20}' and have infinite distance i <=> '{51}'.
*
* When ordering by distance the order of this bunch of arrays with infinite
* distance is not determined and may depend of PostgreSQL version and system.
* Adding another sort expression to ORDER BY may cause another plan that
* doesn't use ordering provided by index.
* That's why we use the query you see below. We substitute 'Infinity' distance
* value with -1 because 'Infinity' are printed differently in output in
* different PostgreSQL versions. We substitute arrays that have infinite
* distance with {-1} because their order is undefined and we wnat to determine
* the test output.
* We don't add another sort expression to ORDER BY because that might cause
* the planner to avoid using the index. Instead, we replace arrays that have
* infinite distance with {-1} to unambiguously determine the test output.
*
* 'Infinity' is printed differently in the output in different PostgreSQL
* versions, so we replace it with -1.
*/
CREATE TABLE test_array_order (
i int2[]
);
\copy test_array_order(i) from 'data/rum_array.data';
CREATE INDEX idx_array_order ON test_array_order USING rum (i rum_anyarray_ops);
/* Check that plan of the query uses ordering provided by index scan */
/*
* Check that plan of the query uses ordering provided by index scan
*/
EXPLAIN (COSTS OFF)
SELECT
CASE WHEN distance = 'Infinity' THEN '{-1}'
Expand Down
26 changes: 14 additions & 12 deletionssql/array.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -211,20 +211,19 @@ DROP INDEX idx_array;
/*
* Check ordering using distance operator
*
* The idea of the test:
* We want to check that index scan provides as correct ordering by distance
* We want to check that index scan provides us correct ordering by distance
* operator. File 'data/rum_array.data' contains two arrays that statisfy
* i @> '{23,20}' and have finite distance i <=> '{51}', and a bunch of arrays
* that statisfy i @> '{23,20}' and have infinite distance i <=> '{51}'. When
* ordering by distance the order of this bunch of arrays with infinite
* that statisfy i @> '{23,20}' and have infinite distance i <=> '{51}'.
*
* When ordering by distance the order of this bunch of arrays with infinite
* distance is not determined and may depend of PostgreSQL version and system.
* Adding another sort expression to ORDER BY may cause another plan that
* doesn't use ordering provided by index.
* That's why we use the query you see below. We substitute 'Infinity' distance
* value with -1 because 'Infinity' are printed differently in output in
* different PostgreSQL versions. We substitute arrays that have infinite
* distance with {-1} because their order is undefined and we wnat to determine
* the test output.
* We don't add another sort expression to ORDER BY because that might cause
* the planner to avoid using the index. Instead, we replace arrays that have
* infinite distance with {-1} to unambiguously determine the test output.
*
* 'Infinity' is printed differently in the output in different PostgreSQL
* versions, so we replace it with -1.
*/

CREATE TABLE test_array_order (
Expand All@@ -234,7 +233,10 @@ CREATE TABLE test_array_order (

CREATE INDEX idx_array_order ON test_array_order USING rum (i rum_anyarray_ops);

/* Check that plan of the query uses ordering provided by index scan */
/*
* Check that plan of the query uses ordering provided by index scan
*/

EXPLAIN (COSTS OFF)
SELECT
CASE WHEN distance = 'Infinity' THEN '{-1}'
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp