Giter Club home page Giter Club logo

fast_io_with_postgrex's Introduction

FastIoWithPostgrex

Screencast link: https://www.youtube.com/watch?v=YQyKRXCtq4s

Fast Import and Export with Elixir and Postgrex - Elixir Hex package showcase Watch us cut the import time from 4 minutes to 1 minute to 1 second and then back to 1.7 seconds :)

NOTES

# A connection pool
elixir      db
  --tcp cx--
  --tcp cx--
  --tcp cx--
  --tcp cx--
  --tcp cx--
  --tcp cx--
  --tcp cx--
  --tcp cx--
  --tcp cx--

Dataset size ~100_000

INSERT/IMPORT into postgresql

on a single process using INSERT
real    3m41.377s
user    0m29.380s
sys     0m8.996s

on 8 processes using INSERT
real    1m8.839s
user    0m38.316s
sys     0m11.332s

on 8 processes using COPY
real    0m1.162s
user    0m1.500s
sys     0m0.220s

on a single process using COPY
real    0m1.747s
user    0m1.460s
sys     0m0.460s

EXPORT from postgresql

real    0m0.640s
user    0m0.644s
sys     0m0.176s

Configuration

One thing I didn't cover in this episode was using the config for configuration, you can do it using:

{:ok, pid} = Application.get_env(:fast_io_with_postgrex, :postgrex)
              |> Postgrex.start_link

fast_io_with_postgrex's People

Contributors

minhajuddin avatar

Watchers

James Cloos avatar Bayu Cahya P 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.