Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2009
    Posts
    2

    Unhappy Unanswered: Insertion rate in Postgres

    Hi Guys,

    I want to increae the insertion rate in postgreSQL. Currently I am using the COPY command of postgres to insert data from a csv file. Can any one help me with a better approach?? Also can any one tell any file format other than CSV to increase the insertion rate??

  2. #2
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    There are a couple things you can do. Copy isn't parallelized so you can split your file and run multiple instances.

    But generally the problem is indexes on the table you are copying to. You'll get some improvement by dropping the index, copying the data then recreating the index. But there is a pgFoundry project called pg_buikload that inserts the data and the index at the same time. You should check it out.

    PgFoundry: pg_bulkload: Project Info

  3. #3
    Join Date
    Sep 2009
    Posts
    2
    Thanks a lot for your reply. I have one more query. Is there any simpler file format other than CSV which postgres understands. If so then can you provide me the metadata for that.

  4. #4
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    I'd recommend sticking w/ csv personally. But do a copy from a table to a file and you'll see that pg uses a tab separated format. I'm sure it requires less quoting because tabs will occur less often than commas in your data. But I doubt it will have much impact.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •