Coder Social home page Coder Social logo

Comments (3)

maxtepkeev avatar maxtepkeev commented on June 1, 2024

Hi Hampus,

Yes, this is a known issue, I'm also aware or the return NULL approach. The reason why it's not used is because in the old days, Django ORM wasn't working with return NULL at all, because it was expecting to receive a newly created object from the database to get it's id.

I haven't tested how new Django versions behave with return NULL approach, maybe this is now fixed and we can drop support for old Django versions in favour of new ones and use the return NULL which as you said will give us an increase in performance. All other supported ORMs should be tested as well.

from architect.

jared-mackey avatar jared-mackey commented on June 1, 2024

I might be interested in taking this on as a learning experience. If you guys could provide an example of the optimized version and the original I would take a look at it. We are using this on our DB and I would like to optimize it as much as possible.

from architect.

maxtepkeev avatar maxtepkeev commented on June 1, 2024

@mackeyja92 Contributions are always welcome. At first we need to check that most recent version of Django is capable of working with this approach, have a look here. This line should be changed to RETURN NULL;. After that rerun architect's partition command to refresh trigger in the database or alternatively you can just modify this line in trigger directly right in the database.

After that try to do some inserts through Django ORM and see if everything works as expected, i.e. you receive newly created object after the call to Model.objects.create(**kwargs), the partition is created successfully and so on. If everything works with Django then, ideally, you need to test the same with older Django versions to find out which of them doesn't support this method so we know which versions to drop, also other supported ORMs should be tested as well. After that let us know the results and I can tell what to do next.

from architect.

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.