Commit 4dafe00
Merge #526
526: Add an orderby when fetching from the database r=bidoubiwa a=bidoubiwa
When using PostgreSQL on a large database, if you paginate using offset, it may happen that psql do not follow the same rule to order the documents.
Meaning that, if I make multiple requests with different offsets, I might receive back documents that I already fetched before.
Exemple:
Running `Select * FROM x OFFSET 100` two times might return different documents.
To tackle that issue, we need to add an `order by` during the request. This ensures the database follows the same order for the documents.
Co-authored-by: Charlotte Vermandel <[email protected]>File tree
2 files changed
+3
-3
lines changed- server
- __tests__
- services/content-types
2 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
0 commit comments