Git Product home page Git Product logo

Comments (5)

ibarwick avatar ibarwick commented on August 15, 2024

Some basic details would be useful:

  • PostgreSQL version
  • Firebird version
  • firebird_fdw and libfq versions

To assist diagnosing the issue, please set client_min_messages to debug2, re-execute the query and attach the output.

from firebird_fdw.

ms3rgio avatar ms3rgio commented on August 15, 2024

Hello, thank you for replying.

Postgres version: PostgreSQL 10.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit
Firebird version: 2.5.9
Firebird_fdw: postgresql10-firebird_fdw-0.5.0-1.x86_64
Libfq: libfq-0.3.0-1.x86_64

debug.txt

from firebird_fdw.

ibarwick avatar ibarwick commented on August 15, 2024

Thanks for the info.

Unfortunately I can't reproduce the issue. Could you execute the query contained in the debug.txt output, i.e.

 SELECT COUNT(*) FROM (
    /* your query here */
 )

and report the output?

What is happening here is that the FDW is trying to fetch an estimate of the table's row count for the PostgreSQL planner. For foreign tables defined as a query, the only way of doing this is to execute the query wrapped in SELECT COUNT(*) FROM ..., which should theoretically only ever return one row. For some reason this is not happening, but the debug output doesn't say how many rows are being returned.

As a workaround, and something I've been meaning to do anyway, I've added a table option estimated_row_count, which makes it possible to specify the approximate number of rows the query would return, and side-step the potentially expensive SELECT COUNT(*) FROM .... This will be in the next release, which should be available in the near future.

It would still be useful to find out what is going on with the SELECT COUNT(*) FROM ... query.

from firebird_fdw.

ibarwick avatar ibarwick commented on August 15, 2024

As a workaround, and something I've been meaning to do anyway, I've added a table option estimated_row_count, which makes it possible to specify the approximate number of rows the query would return, and side-step the potentially expensive SELECT COUNT(*) FROM .... This will be in the next release, which should be available in the near future.

It would still be useful to find out what is going on with the SELECT COUNT(*) FROM ... query.

In the meantime I've made a new release (1.0.0) which contains this functionality, and also better logging of the issue you encountered; it would be helpful if you could try the query with this release and let me know the result.

from firebird_fdw.

ms3rgio avatar ms3rgio commented on August 15, 2024

Hello,

Thank you very much. Now with version 1.0.0 worked correctly, follow the debug log attachment
debug2.txt

from firebird_fdw.

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.