Subject RE: Insert into Large Table is slowly!
Author

>Do you use Classic or SuperServer? Version?

my server run in win2003,FB2.1,SuperServer

>How many cached pages? If you use Classic try increasing page buffers to 2000 and try again.

The Page size is 16KB, buffers is 51200. 

Is enough?

>Let me know the results, thanks.

 Thanks, I will try use GLOBAL TEMPORARY and INACTIVE index.



--- In firebird-support@yahoogroups.com, <fabiano@...> wrote:

Do you use Classic or SuperServer? Version?

How many cached pages? If you use Classic try increasing page buffers to 2000 and try again.

Let me know the results, thanks.

 

De: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Em nome de chmereles@...
Enviada em: quinta-feira, 5 de setembro de 2013 11:58
Para: firebird-support@yahoogroups.com
Assunto: [firebird-support] RE: Insert into Large Table is slowly!

 

 

 

--- In firebird-support@yahoogroups.com, <firebird-support@yahoogroups.com> wrote:

Hello, every body!

  I have a 180GB database. and have a large table in it. 

table's DDL is:

Create Table Table1

(

   f_MeterID Integer,

   f_CMDID smallInt,

   f_Time timestamp,

   f_Value Numric(12,2),

   f_RecTime Timestamp

);

Create Index idx_Table1 on(f_MeterID, f_CMDID, f_Time)

 

about 50,000 rows be inserted every hour. 

about 1.2 millions rows be inserted every day. 

about 500 millions rows every year.


CREATE GLOBAL TEMPORARY TableTemp (
     f_MeterID Integer,
     ....
) ON COMMIT DELETE ROWS;

ALTE R INDEX idx_Table1 INACTIVE;

I insert data use follow:

1. start a transaction

2. Insert a batch records into temp table TableTemp, It's structure like table1

3. Insert into Table1 select * from TableTemp

    Delete Data From TableTemp

    (about 30,000 record every tiime)

USE GLOBAL TEMPORARY

4. commit transaction

ALTER INDEX idx_Table1 ACTIVE

but now, insert data become very slowly.

 

What should I do?

 

thanks!

 

jimmy

Regards.