Giter Site home page Giter Site logo

Comments (2)

rdunklau avatar rdunklau commented on July 23, 2024

This is something I would really like to see happening: not treating the
T_Param specially, and using the whole expression evaluation.

Frankly, the current code to do this is quite ugly and only manages a
subset of the tree.

I'll try to look a bit deeper into it, but I think it would need the
following:

  • The building of the clauses (quals list and params list) is done at plan
    time, and cached for the execution. (via the extract_restrictions
    machinery). This must change, at least for params.
  • At plan time, the restrictions should be scanned again to find every
    T_Var OPERATOR AnyExpr clauses, and evaluate the right hand side (using
    ExecEvalExpr).

I don't really know what amount of work does that entail, but I'm convinced
the resulting code would be cleaner (no more awkward serialization between
plan and execution phase).

If I recall correctly, postgres_fdw does exactly that. You may look at it
for inspiration :)

2013/6/28 David Crawford [email protected]

Since the code only pushes down quals that compare to T_Const, T_Param,
and T_Var, it doesn't evaluate now() (a T_FuncExpr) and push down as a
constant. I don't know enough about PostgreSQL development to know if this
would be easy or hard. I'm happy to contribute this feature if you can give
me a starting point.


Reply to this email directly or view it on GitHubhttps://github.com//issues/18
.

from multicorn.

rdunklau avatar rdunklau commented on July 23, 2024

I just pushed this to the master branch:

  • params are no longer treated specially
  • every expression on the right hand side which does not contain any volatile function (such as random) or a reference to the table itself (ie, col1 = some_function(col2)) will be evaluated at execution time.

from multicorn.

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.