-
Hi everyone. I'm working on a task that involves inserting 200 million records into 5 tables. For instance, since the operation doesn’t require data lookups, temporarily disabling indexes could speed things up. However, I haven’t found a way to disable indexes on foreign keys without dropping and recreating them, which is impractical due to the large number of indexes (dozens per table). My question to the experts is: Is there a mechanism in Firebird to signal that a large-scale data insertion is about to occur, allowing the database to apply optimizations automatically? Or does Firebird handle such scenarios efficiently by default, leaving little room for manual optimization? Below is an example of the SQL query structure I’m using: EXECUTE BLOCK
AS
BEGIN
FOR SELECT ID
FROM TABLE1
INTO :T1_ID
DO
BEGIN
INSERT INTO TABLE2 (ID, ID_TABLE1)
VALUES (NULL, :T1_ID)
RETURNING (ID)
INTO :T2_ID;
INSERT INTO TABLE3 (ID, ID_TABLE2)
VALUES (NULL, :T2_ID);
END
END |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I'll revive #8076 as soon as time permit. But the first question in situations like this: "Do you really need all these data in the database twice?" |
Beta Was this translation helpful? Give feedback.
-
Alright, whatever, closing this. |
Beta Was this translation helpful? Give feedback.
I'll revive #8076 as soon as time permit.
But the first question in situations like this: "Do you really need all these data in the database twice?"