Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    5

    Unanswered: Fill table via PL/PGSQL

    I sit already for two days at this problem. I have a PL/PGSQL - function
    that transfers data from a LOGGING table into a new table.

    The table with the log files is developed as follows.

    Time | Sensor | Value
    -------------------------------
    | |


    The function gets now a time interval, an array of sensors, and
    optional a compression of the data.

    Then the function provides a table so out sees:

    Time | Sensor 1 | Sensor 2 | ... | Sensor n
    ------------------------------------------------------
    | | | |



    Now however so the actually problem.

    I get myself the data and calculate the compression. (one year
    data with average values over a half hour.)

    This action takes 14 seconds.

    The Insert to the new table need 8 seconds. Now Im looking for a method to accelerate the input. I had thought of the COPY instruction but it seems not to be able to use COPY in a script.

    Can someone give me a tip how to insert the data faster to the new table?


    Greeting Henna

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

    index

    try to delete indices and then insert and then recreate the index
    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
  •