Git Product home page Git Product logo

Comments (6)

hnwyllmm avatar hnwyllmm commented on June 5, 2024

Thanks.
Do you have some suggestions? Or would you like to create a pull request?

from miniob.

warr99 avatar warr99 commented on June 5, 2024

Thanks. Do you have some suggestions? Or would you like to create a pull request?

To minimize code structure modifications as much as possible, my current solution is to add a boolean property called idx_need_increase_ within the IndexScanPhysicalOperator class, with a default value of true. I would also provide methods set_idx_need_increase() and get_idx_need_increase(). In the DeletePhysicalOperator::next() function, if the record deletion is successful, I would attempt to cast the PhysicalOperator* child into an IndexScanPhysicalOperator*. If the casting is successful, I would then call set_idx_need_increase() to set it to false. In the next_entry() function, I would use the provided idx_need_increase parameter to decide whether to perform the iter_index_++ operation.

If you think this approach is feasible, I can submit a pull request (PR), or you can provide me with some suggestions.

from miniob.

hnwyllmm avatar hnwyllmm commented on June 5, 2024

Thanks for your suggestion. It looks not a perfect solution.

  1. Your solution only suit for deletion and cannot used in insertion scenario
  2. Cast the child to specific type is not a generic method.

Do you know the method that some real-database uses, such as mysql, postgresql?
And it also looked like std::iterator with insert/delete.

from miniob.

warr99 avatar warr99 commented on June 5, 2024

Do you mean that, similar to using erase() for deleting elements in a vector, it returns a valid iterator? I'm not very familiar with how MySQL/PostgreSQL implement this feature. Could you provide me with some keywords so that I can try to implement this solution?

from miniob.

hnwyllmm avatar hnwyllmm commented on June 5, 2024

std::iterator cannot deal with erase or insert correctly.
I'm sorry that I am not familiar with mysql/postgresql too and I cannot provide any useful information too.
I will trace this issue and if you have any other ideas, discussion is welcome.

from miniob.

0130w avatar 0130w commented on June 5, 2024

Is it possible to fix this bug? The test samples in the competition involve this issue, and it won't pass the test if it's not fixed.

from miniob.

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.