GithubHelp home page GithubHelp logo

Comments (3)

horiguti avatar horiguti commented on August 17, 2024

The repor doesn't work for me, with any ordering of the two extensions in shared_preload_libraries and both -f or not. Do you suppose some other conditions for the behavior?

from pg_hint_plan.

higuchi-daisuke avatar higuchi-daisuke commented on August 17, 2024

Hi, I'm sorry for confusing you.
I could not reproduce this issue even if I follow the procedure in my first post..
So, I write the simple procedure to reproduce. I use pg_hint_plan REL95_1_1_8 and PostgreSQL 9.5.21.

  1. Initial setup by following my first post.
  2. Execute following command:
    psql -c "EXPLAIN SELECT /*+ MergeJoin(t1 t2) */ T1.C1,T2.C1 FROM S1.T1,S1.T2 WHERE T1.C1=T2.C1;"

I confirm not Merge Join but Hash Join from explain information of 2.

[ A little investigation ]
When new session starts, pg_dbms_stats needs to search "locked statistics" tables, I think.
If so, this behavior is similar to the following comment of commit 000c325.

Hints lose effect when pg_dbms_stats searches "locked statistics" tables 
while planning the target query.

from pg_hint_plan.

horiguti avatar horiguti commented on August 17, 2024

OK, I confirmed that when both pg_hint_plan and pg_dbms_stats are preloaded, running the given query as the first query in a session doesn't honor the hint. Some digging on the repository told me that a change committed fife years ago (9.4 era) have broken the previous behavior.
Fixed it. Patched from PG94 up to master (PG12).

4e63a22

from pg_hint_plan.

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.