Guest User

Untitled

a guest
Jun 20th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. 1. 146 schema migration (spaces cluster)
  2. safe to run
  3.  
  4. 2. 147 schema migration (metric_key_id)
  5. safe to run
  6. took 10min on stage
  7.  
  8. 3. 148 schema migration (metric_key_name_id, also metric_key_id FK)
  9. safe to run
  10. took 1528s on stage
  11.  
  12. Per space part:
  13.  
  14. 4. 036 data migration (metric_key_names metric_key_id)
  15. run per space
  16. took 1536s on stage for 5147 for 75836 records
  17. **make index and then it will be faster**
  18.  
  19. 5. 037 data migration
  20. run per space
  21. took 2.4s on stage for 5147 for 75836 records
  22. **that was with index**
  23.  
  24.  
  25.  
  26.  
  27. ## Important as fuck:
  28.  
  29. - FK constraint on metric_key_names was dropped after migration finished. It will (and must) be added when all metric_key_names have their respective metric_key_id. And then cascade delete must be added. So
  30.  
  31. `ALTER TABLE metric_key_names ADD CONSTRAINT fk_metric_key_names FOREIGN KEY (metric_key_id) REFERENCES metric_keys(metric_key_id);`
  32.  
  33. Must also include on delete cascade.
Add Comment
Please, Sign In to add comment