Commit 3869823
committed
[TASK] Avoid costly database schema queries and class state
Some places in our code base need to deal with database schema
information, which are quite costly doing them over and over again.
This change streamlines occurrences to use the internal cached
schema information (`Connection->getSchemaInformation()`) to
replace the occurrences and centralizing them to one place. With
that, instance state can be removed in two cases and in one case
the uncached usage replaced by the cached schema information.
`SchemaInformation->listTableColumns()` is added to mimic the
`AbstractSchemaManager->listTableColumns()` method and return
same structure `array<string, Column>` instead of `Column[]`,
considerable not a feature and doable as task because the
complete class is marked as `@internal`.
Note that `SchemaInformation` uses only a code cache right now
and will get a second level (`runtime`) cache in a dedicated
change eliminating the need to read it from PHP files over and
over again.
Resolves: #107390
Releases: main
Change-Id: Ia7e60a0691eebf91a2fc284c17b7f424efd406c6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/90562
Tested-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Benni Mack <benni@typo3.org>1 parent a8f3ce3 commit 3869823
File tree
4 files changed
+25
-33
lines changed- typo3/sysext
- core/Classes
- Database/Schema
- Resource
- Index
- lowlevel/Classes/Controller
4 files changed
+25
-33
lines changedLines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
68 | 84 | | |
69 | 85 | | |
70 | 86 | | |
| |||
Lines changed: 4 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 48 | | |
56 | 49 | | |
57 | 50 | | |
| |||
228 | 221 | | |
229 | 222 | | |
230 | 223 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
239 | 228 | | |
240 | 229 | | |
Lines changed: 4 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 42 | | |
51 | 43 | | |
52 | 44 | | |
| |||
329 | 321 | | |
330 | 322 | | |
331 | 323 | | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
341 | 328 | | |
342 | 329 | | |
343 | 330 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2711 | 2711 | | |
2712 | 2712 | | |
2713 | 2713 | | |
2714 | | - | |
| 2714 | + | |
2715 | 2715 | | |
2716 | 2716 | | |
2717 | 2717 | | |
| |||
0 commit comments