This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch fix_orca_gist
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 6ce954637664f786938543a1ec19a6c33efe61e3
Author: Jianghua Yang <[email protected]>
AuthorDate: Tue Mar 31 09:32:02 2026 +0800

    fix  btree_gist test
---
 contrib/btree_gist/expected/cash_optimizer.out     | 11 +++++-----
 contrib/btree_gist/expected/date_optimizer.out     |  7 +++----
 contrib/btree_gist/expected/float4_optimizer.out   |  7 +++----
 contrib/btree_gist/expected/float8_optimizer.out   |  7 +++----
 contrib/btree_gist/expected/int2_optimizer.out     |  7 +++----
 contrib/btree_gist/expected/int4_optimizer.out     |  7 +++----
 contrib/btree_gist/expected/int8_optimizer.out     |  7 +++----
 contrib/btree_gist/expected/interval_optimizer.out | 24 +++++++++++-----------
 contrib/btree_gist/expected/time_optimizer.out     |  7 +++----
 .../btree_gist/expected/timestamp_optimizer.out    |  7 +++----
 .../btree_gist/expected/timestamptz_optimizer.out  |  7 +++----
 11 files changed, 44 insertions(+), 54 deletions(-)

diff --git a/contrib/btree_gist/expected/cash_optimizer.out 
b/contrib/btree_gist/expected/cash_optimizer.out
index 171dec7e511..f2c9ac07420 100644
--- a/contrib/btree_gist/expected/cash_optimizer.out
+++ b/contrib/btree_gist/expected/cash_optimizer.out
@@ -77,12 +77,11 @@ SELECT a, a <-> '21472.79' FROM moneytmp ORDER BY a <-> 
'21472.79' LIMIT 3;
                          QUERY PLAN                         
 ------------------------------------------------------------
  Limit
-   ->  Sort
-         Sort Key: ((a <-> '$21,472.79'::money))
-         ->  Result
-               ->  Gather Motion 3:1  (slice1; segments: 3)
-                     ->  Seq Scan on moneytmp
- Optimizer: GPORCA
+   ->  Gather Motion 3:1  (slice1; segments: 3)
+         Merge Key: ((a <-> '$21,472.79'::money))
+         ->  Limit
+               ->  Index Only Scan using moneyidx on moneytmp
+                     Order By: (a <-> '$21,472.79'::money)
 (7 rows)
 
 SELECT a, a <-> '21472.79' FROM moneytmp ORDER BY a <-> '21472.79' LIMIT 3;
diff --git a/contrib/btree_gist/expected/date_optimizer.out 
b/contrib/btree_gist/expected/date_optimizer.out
index a77041f847f..12269cf169b 100644
--- a/contrib/btree_gist/expected/date_optimizer.out
+++ b/contrib/btree_gist/expected/date_optimizer.out
@@ -79,10 +79,9 @@ SELECT a, a <-> '2001-02-13' FROM datetmp ORDER BY a <-> 
'2001-02-13' LIMIT 3;
  Limit
    ->  Gather Motion 3:1  (slice1; segments: 3)
          Merge Key: ((a <-> '02-13-2001'::date))
-         ->  Sort
-               Sort Key: ((a <-> '02-13-2001'::date))
-               ->  Seq Scan on datetmp
- Optimizer: GPORCA
+         ->  Limit
+               ->  Index Only Scan using dateidx on datetmp
+                     Order By: (a <-> '02-13-2001'::date)
 (7 rows)
 
 SELECT a, a <-> '2001-02-13' FROM datetmp ORDER BY a <-> '2001-02-13' LIMIT 3;
diff --git a/contrib/btree_gist/expected/float4_optimizer.out 
b/contrib/btree_gist/expected/float4_optimizer.out
index cc40e9bd1ae..7b71a2f5112 100644
--- a/contrib/btree_gist/expected/float4_optimizer.out
+++ b/contrib/btree_gist/expected/float4_optimizer.out
@@ -79,10 +79,9 @@ SELECT a, a <-> '-179.0' FROM float4tmp ORDER BY a <-> 
'-179.0' LIMIT 3;
  Limit
    ->  Gather Motion 3:1  (slice1; segments: 3)
          Merge Key: ((a <-> '-179'::real))
-         ->  Sort
-               Sort Key: ((a <-> '-179'::real))
-               ->  Seq Scan on float4tmp
- Optimizer: GPORCA
+         ->  Limit
+               ->  Index Only Scan using float4idx on float4tmp
+                     Order By: (a <-> '-179'::real)
 (7 rows)
 
 SELECT a, a <-> '-179.0' FROM float4tmp ORDER BY a <-> '-179.0' LIMIT 3;
diff --git a/contrib/btree_gist/expected/float8_optimizer.out 
b/contrib/btree_gist/expected/float8_optimizer.out
index 1bd96c44d3b..18e5c195286 100644
--- a/contrib/btree_gist/expected/float8_optimizer.out
+++ b/contrib/btree_gist/expected/float8_optimizer.out
@@ -79,10 +79,9 @@ SELECT a, a <-> '-1890.0' FROM float8tmp ORDER BY a <-> 
'-1890.0' LIMIT 3;
  Limit
    ->  Gather Motion 3:1  (slice1; segments: 3)
          Merge Key: ((a <-> '-1890'::double precision))
-         ->  Sort
-               Sort Key: ((a <-> '-1890'::double precision))
-               ->  Seq Scan on float8tmp
- Optimizer: GPORCA
+         ->  Limit
+               ->  Index Only Scan using float8idx on float8tmp
+                     Order By: (a <-> '-1890'::double precision)
 (7 rows)
 
 SELECT a, a <-> '-1890.0' FROM float8tmp ORDER BY a <-> '-1890.0' LIMIT 3;
diff --git a/contrib/btree_gist/expected/int2_optimizer.out 
b/contrib/btree_gist/expected/int2_optimizer.out
index fdfc859097b..f8f6a428b93 100644
--- a/contrib/btree_gist/expected/int2_optimizer.out
+++ b/contrib/btree_gist/expected/int2_optimizer.out
@@ -79,10 +79,9 @@ SELECT a, a <-> '237' FROM int2tmp ORDER BY a <-> '237' 
LIMIT 3;
  Limit
    ->  Gather Motion 3:1  (slice1; segments: 3)
          Merge Key: ((a <-> '237'::smallint))
-         ->  Sort
-               Sort Key: ((a <-> '237'::smallint))
-               ->  Seq Scan on int2tmp
- Optimizer: GPORCA
+         ->  Limit
+               ->  Index Only Scan using int2idx on int2tmp
+                     Order By: (a <-> '237'::smallint)
 (7 rows)
 
 SELECT a, a <-> '237' FROM int2tmp ORDER BY a <-> '237' LIMIT 3;
diff --git a/contrib/btree_gist/expected/int4_optimizer.out 
b/contrib/btree_gist/expected/int4_optimizer.out
index 67107e63bfa..6877fb09af5 100644
--- a/contrib/btree_gist/expected/int4_optimizer.out
+++ b/contrib/btree_gist/expected/int4_optimizer.out
@@ -79,10 +79,9 @@ SELECT a, a <-> '237' FROM int4tmp ORDER BY a <-> '237' 
LIMIT 3;
  Limit
    ->  Gather Motion 3:1  (slice1; segments: 3)
          Merge Key: ((a <-> 237))
-         ->  Sort
-               Sort Key: ((a <-> 237))
-               ->  Seq Scan on int4tmp
- Optimizer: GPORCA
+         ->  Limit
+               ->  Index Only Scan using int4idx on int4tmp
+                     Order By: (a <-> 237)
 (7 rows)
 
 SELECT a, a <-> '237' FROM int4tmp ORDER BY a <-> '237' LIMIT 3;
diff --git a/contrib/btree_gist/expected/int8_optimizer.out 
b/contrib/btree_gist/expected/int8_optimizer.out
index ba8e21135e8..962dd314661 100644
--- a/contrib/btree_gist/expected/int8_optimizer.out
+++ b/contrib/btree_gist/expected/int8_optimizer.out
@@ -79,10 +79,9 @@ SELECT a, a <-> '464571291354841' FROM int8tmp ORDER BY a 
<-> '464571291354841'
  Limit
    ->  Gather Motion 3:1  (slice1; segments: 3)
          Merge Key: ((a <-> '464571291354841'::bigint))
-         ->  Sort
-               Sort Key: ((a <-> '464571291354841'::bigint))
-               ->  Seq Scan on int8tmp
- Optimizer: GPORCA
+         ->  Limit
+               ->  Index Only Scan using int8idx on int8tmp
+                     Order By: (a <-> '464571291354841'::bigint)
 (7 rows)
 
 SELECT a, a <-> '464571291354841' FROM int8tmp ORDER BY a <-> 
'464571291354841' LIMIT 3;
diff --git a/contrib/btree_gist/expected/interval_optimizer.out 
b/contrib/btree_gist/expected/interval_optimizer.out
index f5afd17456b..f0a4e850aeb 100644
--- a/contrib/btree_gist/expected/interval_optimizer.out
+++ b/contrib/btree_gist/expected/interval_optimizer.out
@@ -74,15 +74,15 @@ SELECT count(*) FROM intervaltmp WHERE a >  '199 days 
21:21:23'::interval;
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '199 days 21:21:23' FROM intervaltmp ORDER BY a <-> '199 days 
21:21:23' LIMIT 3;
-                                    QUERY PLAN                                 
    
------------------------------------------------------------------------------------
+                                      QUERY PLAN                               
        
+---------------------------------------------------------------------------------------
  Limit
    ->  Gather Motion 3:1  (slice1; segments: 3)
          Merge Key: ((a <-> '@ 199 days 21 hours 21 mins 23 secs'::interval))
-         ->  Sort
-               Sort Key: ((a <-> '@ 199 days 21 hours 21 mins 23 
secs'::interval))
-               ->  Seq Scan on intervaltmp
- Optimizer: GPORCA
+         ->  Limit
+               ->  Index Only Scan using intervalidx on intervaltmp
+                     Order By: (a <-> '@ 199 days 21 hours 21 mins 23 
secs'::interval)
+ Optimizer: Postgres query optimizer
 (7 rows)
 
 SELECT a, a <-> '199 days 21:21:23' FROM intervaltmp ORDER BY a <-> '199 days 
21:21:23' LIMIT 3;
@@ -96,15 +96,15 @@ SELECT a, a <-> '199 days 21:21:23' FROM intervaltmp ORDER 
BY a <-> '199 days 21
 SET enable_indexonlyscan=off;
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '199 days 21:21:23' FROM intervaltmp ORDER BY a <-> '199 days 
21:21:23' LIMIT 3;
-                                    QUERY PLAN                                 
    
------------------------------------------------------------------------------------
+                                      QUERY PLAN                               
        
+---------------------------------------------------------------------------------------
  Limit
    ->  Gather Motion 3:1  (slice1; segments: 3)
          Merge Key: ((a <-> '@ 199 days 21 hours 21 mins 23 secs'::interval))
-         ->  Sort
-               Sort Key: ((a <-> '@ 199 days 21 hours 21 mins 23 
secs'::interval))
-               ->  Seq Scan on intervaltmp
- Optimizer: GPORCA
+         ->  Limit
+               ->  Index Scan using intervalidx on intervaltmp
+                     Order By: (a <-> '@ 199 days 21 hours 21 mins 23 
secs'::interval)
+ Optimizer: Postgres query optimizer
 (7 rows)
 
 SELECT a, a <-> '199 days 21:21:23' FROM intervaltmp ORDER BY a <-> '199 days 
21:21:23' LIMIT 3;
diff --git a/contrib/btree_gist/expected/time_optimizer.out 
b/contrib/btree_gist/expected/time_optimizer.out
index 590ada880b9..40d49e79b02 100644
--- a/contrib/btree_gist/expected/time_optimizer.out
+++ b/contrib/btree_gist/expected/time_optimizer.out
@@ -79,10 +79,9 @@ SELECT a, a <-> '10:57:11' FROM timetmp ORDER BY a <-> 
'10:57:11' LIMIT 3;
  Limit
    ->  Gather Motion 3:1  (slice1; segments: 3)
          Merge Key: ((a <-> '10:57:11'::time without time zone))
-         ->  Sort
-               Sort Key: ((a <-> '10:57:11'::time without time zone))
-               ->  Seq Scan on timetmp
- Optimizer: GPORCA
+         ->  Limit
+               ->  Index Only Scan using timeidx on timetmp
+                     Order By: (a <-> '10:57:11'::time without time zone)
 (7 rows)
 
 SELECT a, a <-> '10:57:11' FROM timetmp ORDER BY a <-> '10:57:11' LIMIT 3;
diff --git a/contrib/btree_gist/expected/timestamp_optimizer.out 
b/contrib/btree_gist/expected/timestamp_optimizer.out
index 1b8e709fe90..85c3a1a5e5d 100644
--- a/contrib/btree_gist/expected/timestamp_optimizer.out
+++ b/contrib/btree_gist/expected/timestamp_optimizer.out
@@ -79,10 +79,9 @@ SELECT a, a <-> '2004-10-26 08:55:08' FROM timestamptmp 
ORDER BY a <-> '2004-10-
  Limit
    ->  Gather Motion 3:1  (slice1; segments: 3)
          Merge Key: ((a <-> 'Tue Oct 26 08:55:08 2004'::timestamp without time 
zone))
-         ->  Sort
-               Sort Key: ((a <-> 'Tue Oct 26 08:55:08 2004'::timestamp without 
time zone))
-               ->  Seq Scan on timestamptmp
- Optimizer: GPORCA
+         ->  Limit
+               ->  Index Only Scan using timestampidx on timestamptmp
+                     Order By: (a <-> 'Tue Oct 26 08:55:08 2004'::timestamp 
without time zone)
 (7 rows)
 
 SELECT a, a <-> '2004-10-26 08:55:08' FROM timestamptmp ORDER BY a <-> 
'2004-10-26 08:55:08' LIMIT 3;
diff --git a/contrib/btree_gist/expected/timestamptz_optimizer.out 
b/contrib/btree_gist/expected/timestamptz_optimizer.out
index 2173c5dca35..a9e043f98a6 100644
--- a/contrib/btree_gist/expected/timestamptz_optimizer.out
+++ b/contrib/btree_gist/expected/timestamptz_optimizer.out
@@ -199,10 +199,9 @@ SELECT a, a <-> '2018-12-18 10:59:54 GMT+2' FROM 
timestamptztmp ORDER BY a <-> '
  Limit
    ->  Gather Motion 3:1  (slice1; segments: 3)
          Merge Key: ((a <-> 'Tue Dec 18 04:59:54 2018 PST'::timestamp with 
time zone))
-         ->  Sort
-               Sort Key: ((a <-> 'Tue Dec 18 04:59:54 2018 PST'::timestamp 
with time zone))
-               ->  Seq Scan on timestamptztmp
- Optimizer: GPORCA
+         ->  Limit
+               ->  Index Only Scan using timestamptzidx on timestamptztmp
+                     Order By: (a <-> 'Tue Dec 18 04:59:54 2018 
PST'::timestamp with time zone)
 (7 rows)
 
 SELECT a, a <-> '2018-12-18 10:59:54 GMT+2' FROM timestamptztmp ORDER BY a <-> 
'2018-12-18 10:59:54 GMT+2' LIMIT 3;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to