Code Monkey home page Code Monkey logo

Comments (2)

ashwinstar avatar ashwinstar commented on June 27, 2024

(not based on actual debugging the code... surface code browsing) The callers to EOXactListAdd() are RelationBuildLocalRelation() and RelationSetNewRelfilenode(). Both will only be called for writer gang QE and not reader gang QE. Hence, eoxact_list will not be populated for reader QEs. Hence can't use eoxact_list or eoxact_list_overflowed for reader QEs to perform targeted cleanup of Relcache. That's the reason current behavior is to clean full relcache based on hashtable acting similar to overflow case.

If really wish to optimize then might have to look into ways to pass this info from QE Writers to QE readers. Above example query I expect will only execute in QE writer and doesn't need slices, it will not even have why DTX_CONTEXT_QE_READER. Instead it will be DTX_CONTEXT_QE_AUTO_COMMIT_IMPLICIT. So I am missing it will not even flow through the case you mentioned. Please can you explain more and with evidence clarify the situation more.

from gpdb.

maliangzhu avatar maliangzhu commented on June 27, 2024

Sorry, my case has some mistake . only select * from t1 will not scan heap again. The actural case has motion like this:

postgres=# select * from t1,t2;
WARNING:  no index  (seg2 slice2 10.10.2.165:6002 pid=3631)
WARNING:  no index  (seg0 slice2 10.10.2.165:6000 pid=3630)
WARNING:  no index  (seg1 slice2 10.10.2.165:6001 pid=3632)
 a | b 
---+---
(0 rows) 

postgres=# select * from t1,t2;
WARNING:  no index  (seg1 slice2 10.10.2.165:6001 pid=3632)
WARNING:  no index  (seg0 slice2 10.10.2.165:6000 pid=3630)
WARNING:  no index  (seg2 slice2 10.10.2.165:6002 pid=3631)
 a | b 
---+---
(0 rows)

postgres=# explain select * from t1,t2;
                                         QUERY PLAN                                          
---------------------------------------------------------------------------------------------
 Gather Motion 3:1  (slice1; segments: 3)  (cost=0.00..1324032.11 rows=1 width=8)
   ->  Nested Loop  (cost=0.00..1324032.11 rows=1 width=8)
         Join Filter: true
         ->  Broadcast Motion 3:3  (slice2; segments: 3)  (cost=0.00..431.00 rows=1 width=4)
               ->  Seq Scan on t1  (cost=0.00..431.00 rows=1 width=4)
         ->  Seq Scan on t2  (cost=0.00..431.00 rows=1 width=4)
 Optimizer: GPORCA
(7 rows)

postgres=# select version();
                                                                                                      version                                                                                               
       
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------
 PostgreSQL 12.12 (Greenplum Database 7.2.0-rc.1+dev.58.g0d1c4aa361 build dev) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3), 64-bit compiled on May 10 2024 22:05:50 Bhuvn
esh C.
(1 row)

I added some code that can show "no index"

diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c
index 42aaa5bad6..6298d20a6f 100644
--- a/src/backend/access/index/genam.c
+++ b/src/backend/access/index/genam.c
@@ -468,6 +468,7 @@ systable_getnext(SysScanDesc sysscan)
        }
        else
        {
+               elog(WARNING,"no index");
                if (table_scan_getnextslot(sysscan->scan, ForwardScanDirection, sysscan->slot))
                {
                        bool            shouldFree;

from gpdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.