Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
09f7d53f
Commit
09f7d53f
authored
Feb 20, 2019
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "Seeding an empty database" section
parent
ee0a007f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
doc/development/performance.md
doc/development/performance.md
+15
-0
No files found.
doc/development/performance.md
View file @
09f7d53f
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment