Git Product home page Git Product logo

django-bulk-load's Introduction

What This Is

It's the sample code for a presentation comparing different methods of loading bulk data into a Postgres database using Python -- sometimes with Django, sometimes without

Running the Samples

Once you create the table (in some form of Postgres), the good stuff is in website/demo3/scripts. You can run the scripts with

python manage.py runscript <script-name>

(without the .py extension). Some of the scripts don't use any part of Django, but I'm still using the django-extensions "runscript" command just for consistency

Observations

  • The obvious speed champion is d_make_bulk_file -- if you don't mind the complexity
  • I'm surprised at how much faster it is to create a psycopg2 connection and use that, rather than using the one you get by from django.db import connection

Future Research

  • psycopg3 is out, and it supports prepared statements under certain conditions.
    • You can't use prepared statements with PgBouncer (maybe you could fake it with transactions). I'd hate to lose PgBouncer -- that might be the cheapest peformance win in history (if you have a lot of connections)
    • There are syntax and behavioral changes in psycopg3, but you're probably going to have to deal with that sooner or later

django-bulk-load's People

Contributors

ccurvey avatar

Watchers

 avatar

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.