Giter VIP home page Giter VIP logo

Comments (5)

Dig-Doug avatar Dig-Doug commented on August 20, 2024 1

Yes, removing the sort allows the connector to start syncing.

For reference, here is a comparison of the costs for misordering the keys:

EXPLAIN SELECT * FROM document_snippets ORDER BY id, source_document_id LIMIT 1000 OFFSET 2000;

Limit  (cost=2440052.09..2440168.76 rows=1000 width=1405)
  ->  Gather Merge  (cost=2439818.74..2679752.32 rows=2056430 width=1405)
        Workers Planned: 2
        ->  Sort  (cost=2438818.72..2441389.25 rows=1028215 width=1405)
              Sort Key: id, source_document_id
              ->  Parallel Seq Scan on document_snippets  (cost=0.00..448904.15 rows=1028215 width=1405)

EXPLAIN SELECT * FROM document_snippets ORDER BY source_document_id,id LIMIT 1000 OFFSET 2000;

Limit  (cost=5294.09..7940.85 rows=1000 width=1405)
  ->  Index Scan using document_snippets_pkey on document_snippets  (cost=0.56..6531468.94 rows=2467717 width=1405)

from connectors.

Dig-Doug avatar Dig-Doug commented on August 20, 2024

I believe this is actually a symptom of incorrectly ordering the primary keys.

This table has a compound primary key:

CREATE TABLE document_snippets(
  source_document_id text,
  id text,
  PRIMARY KEY (source_document_id, id)
)

But in the error, the components are reversed ORDER BY id, source_document_id which will lead to a very expensive query.

from connectors.

Dig-Doug avatar Dig-Doug commented on August 20, 2024

The primary keys are sorted here, making the order inefficient.

from connectors.

artem-shelkovnikov avatar artem-shelkovnikov commented on August 20, 2024

Hi @Dig-Doug, have you tested if removing sorting makes it work for you?

from connectors.

artem-shelkovnikov avatar artem-shelkovnikov commented on August 20, 2024

If you want you can make a contribution to us with the change you've made. If not, we'll address it but probably a bit later.

Would you like to contribute?

from connectors.

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.