Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2004
    Posts
    7

    Unanswered: Postgres is very slow

    I need help.

    I have a piece of data about 60,000 line. When I insert into Postgres it take around 20 minutes. If I insert this data into Oracle it will take 2 minutes and around 50 seconds if I use MYSQL.

    Why it take so long for Postgres.

    Thanks.

  2. #2
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    Copy or insert

    If you used Insert instead of copy then the problem is clear

    Did you do this?

    or do you used copy
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  3. #3
    Join Date
    Aug 2004
    Posts
    7

    I used insert

    I use and insert

  4. #4
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400
    you must use the copy command

    then it's about 1 minute I estimate
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  5. #5
    Join Date
    Aug 2004
    Posts
    7
    Do you why the timing is so much different between insert & copy?

  6. #6
    Join Date
    Aug 2004
    Posts
    7
    I thought I can only use COPY for file only.

  7. #7
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    insert

    how do you insert the data from a file or from an application?

    when you do single inserts it recreats the index after every insert

    I think copy makes all in one transaction and does some index stuff
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  8. #8
    Join Date
    Aug 2004
    Posts
    7
    Yes, I am using it from an application that will be input from the client.

  9. #9
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    Copy

    copy is possible from within an application
    I used it in perl

    there is a special command for this
    you open copy as a stream and then feed it with data

    maybe you are googling around to find somethign useful for that
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

Posting Permissions

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