diff options
author | Nick Thomas <nick@gitlab.com> | 2019-02-22 10:22:02 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-02-22 10:22:02 +0300 |
commit | d93d799bde3ee8082c1fd04387bd9bf0979a212d (patch) | |
tree | 4fcf7247d0674241107cc31fff02ce6d60422ad5 /doc/development | |
parent | 4bb06df7771999d13261d0cd05d678d89cba9aba (diff) | |
parent | 09f7d53ff2723719a7641204941efaefc6aabd36 (diff) |
Merge branch 'mk/seeding-an-empty-database-docs' into 'master'
Add "How to seed a database with millions of rows" section
See merge request gitlab-org/gitlab-ce!25439
Diffstat (limited to 'doc/development')
-rw-r--r-- | doc/development/performance.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/development/performance.md b/doc/development/performance.md index 32970152911..2a287611bdf 100644 --- a/doc/development/performance.md +++ b/doc/development/performance.md @@ -410,6 +410,21 @@ there's nothing stopping somebody from doing this elsewhere in the code: SOME_CONSTANT = 'bar' ``` +## How to seed a database with millions of rows + +You might want millions of project rows in your local database, for example, +in order to compare relative query performance, or to reproduce a bug. You could +do this by hand with SQL commands, but since you have ActiveRecord models, you +might find using these gems more convenient: + +- [BulkInsert gem](https://github.com/jamis/bulk_insert) +- [ActiveRecord::PgGenerateSeries gem](https://github.com/ryu39/active_record-pg_generate_series) + +### Examples + +You may find some useful examples in this snippet: +https://gitlab.com/gitlab-org/gitlab-ce/snippets/33946 + [#15607]: https://gitlab.com/gitlab-org/gitlab-ce/issues/15607 [yorickpeterse]: https://gitlab.com/yorickpeterse [anti-pattern]: https://en.wikipedia.org/wiki/Anti-pattern |