Commit Graph

151 Commits (feat/database/query-result-fetch-associative-fetch-num)

Author SHA1 Message Date
Joas Schilling ab70bbd3ff
fix(db)!: Remove private legacy event because we can not keep it
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-24 14:51:35 +07:00
Joas Schilling 86310a35b2
fix(db): Move missing core indices to typed event
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-24 14:51:34 +07:00
Joas Schilling 00d483585b
fix: Add options to support all used features by core
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-24 14:51:34 +07:00
Joas Schilling f73f14207c
fix(db): Move missing core columns to typed event
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-24 14:51:33 +07:00
Joas Schilling 77c2b169a5
fix(db): Move missing core primary keys to typed event
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-24 14:51:33 +07:00
Joas Schilling bd0a149a4f
feat(dispatcher): Add typed event for "db:add-missing-primary-keys"
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-24 14:51:32 +07:00
Joas Schilling 2eded24eff
feat(dispatcher): Add typed event for "db:add-missing-columns"
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-24 14:51:32 +07:00
Julius Härtl 2601db240f
Merge pull request #39389 from nextcloud/enh/add-missing-indices-event 2023-07-14 14:21:39 +07:00
Julius Härtl 925bcebcb6
feat: Add public event for missing indices
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-07-14 13:11:22 +07:00
Arthur Schiwon e5160e0c1c
fix(db): no hardcoded table prefix is expected
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-07-13 23:34:39 +07:00
Marcel Klehr fcf1c3033b fix(systemtags): Add missing systemtags index
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2023-06-21 15:20:30 +07:00
Faraz Samapoor 1e8ec53b8c Update core/Command/Db/ConvertType.php
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
2023-06-19 12:55:15 +07:00
Faraz Samapoor 73d7c45ae1 Update core/Command/Db/ConvertFilecacheBigInt.php
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
2023-06-19 12:55:15 +07:00
Faraz Samapoor d34cafc58c Update core/Command/Db/Migrations/MigrateCommand.php
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
2023-06-19 12:55:15 +07:00
Faraz Samapoor f1a19a10fc Update core/Command/Db/Migrations/StatusCommand.php
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
2023-06-19 12:55:15 +07:00
Faraz Samapoor b5cbba7fc1 Uses PHP8's constructor property promotion in core/Command/Db classes.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
2023-06-19 12:55:15 +07:00
Robin Appelman db43d90387
add new index in repair step instead of on-migrate
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-28 15:08:08 +07:00
Louis Chemineau bda66f9fb6 Add parent index on filecache
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-03-20 15:02:23 +07:00
Vitor Mattos fd4c53f311 Fix typo that added a letter to migration template
Signed-off-by: Vitor Mattos <vitor@php.rio>
2023-02-25 12:48:22 +07:00
Roeland Jago Douma aaf9b9c4fd
properly typehint generated migrations
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2022-10-09 21:26:16 +07:00
timm2k 6ff58d30b4
Update ConvertFilecacheBigInt.php
Signed-off-by: timm2k <timm2k@gmx.de>
2022-09-14 10:15:16 +07:00
Marcel Klehr 047cc708d4 DB mounts table: Add index for mount_provider_class
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2022-08-01 14:27:34 +07:00
Carl Schwan b70c6a128f Update core to PHP 7.4 standard
- Typed properties
- Port to LoggerInterface

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-20 22:18:06 +07:00
Joas Schilling 60801d8b1c
Fix strict comparison
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-27 20:31:40 +07:00
Joas Schilling 2ffcc08332
Fix type fixing
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-25 16:49:23 +07:00
Joas Schilling 7ee982005a
Give hints on correct migration versioning
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-25 16:21:25 +07:00
Julius Härtl 7fbd93b2ad
Additional index on oc_preferences to make sure that gettingh values without a user filter is fast
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-04-19 12:37:36 +07:00
Côme Chilliet 9191ca43ce
Merge pull request #31735 from nextcloud/fix/noid/mig-generator-copyright
migration generator also includes copyright section
2022-03-29 16:49:43 +07:00
Côme Chilliet 765999f454
Merge pull request #31609 from nextcloud/fix/migrate-away-from-ilogger
Migrate from ILogger to LoggerInterface in lib/private
2022-03-29 09:39:38 +07:00
Arthur Schiwon ee006563ae
migration generator also includes copyright section
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-03-28 15:35:17 +07:00
Côme Chilliet ea23523c70
Adapt more code to migration to LoggerInterface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +07:00
Louis Chemineau 970fb7ce65 Don't create cards_abiduri it if already exists
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-03-24 10:42:22 +07:00
Christoph Wurst c1000fe344
Merge pull request #31304 from nextcloud/feature/dry_run_for_add_indices
Add --dry-run option for add-missing-* cmd
2022-02-28 09:59:40 +07:00
Louis Chemineau 405c5eb813 Add --dry-run option for db:add-missing-* cmd
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-02-24 16:42:08 +07:00
Carl Schwan db6927ee05 Improve performance when converting between DBs
Use a transaction when doing multiple inserts increase the writing
speed.

Ref: https://stackoverflow.com/a/68495887

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-02-16 18:28:06 +07:00
Julius Härtl 415294e345
Add index for direct editing cleanup job
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-02-07 09:25:27 +07:00
Carl Schwan 6312c0df69
Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 00:19:07 +07:00
Christoph Wurst ed84f07784
Add missing index for propertypath only queries against properties
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-12-23 15:51:50 +07:00
Joas Schilling 536a812de4
Add an index for selecting the next job
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-01 23:57:40 +07:00
Robin Appelman 695326534c
disable path prefix index on postgresql for now
having the index work properly for the queries we need it for requires some additional options which dbal does not support at the momement.
to prevent making it harder to add the correct index later on we don't create the index for now on postgresql

Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-08 18:39:22 +07:00
Robin Appelman abd6b354ac
add a prefix index to filecache.path
The reason that `filecache.path` hasn't had an index added is the mysql limitation of ~1kb for indexeded fields,
which is to small for the `path`, however mysql supports indexing only the first N bytes of a column instead of the entire column,
allowing us to add an index even if the column is to long.

Because the index doesn't cover the entire column it can't be used in all situations where a normal index would be used, but it does cover the `path like 'folder/path/%'` queries that are used in various places.

Sqlite and Postgresql don't support prefix indexes, but they also don't have the 1kb limit and DBAL handles the differences in index creation.

Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-08 18:38:25 +07:00
Robin Appelman 6502dfae34
add better index for finding unindexed paths
for the following query 'SELECT "path" FROM "oc_filecache" WHERE ("storage" = $storage) AND ("size" < 0) ORDER BY "fileid" DESC LIMIT 1;'

currently the database will in some cases decide to priorize the sort by fileid over the filter when picking what index to use, resulting in a much slower query.

by creating an index that allows first sorting by fileid and also filter by storage and size this case will be greatly sped up

Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-07 16:11:49 +07:00
Christoph Wurst bf564e2a5a
Convert command option defaults to strings
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-06-09 13:25:31 +07:00
Christoph Wurst 932a385c56
Merge pull request #27429 from nextcloud/bug/26085/wrong-data-add-order-by
Don't pass a column object to addOrderBy
2021-06-09 09:12:03 +07:00
Daniel Kesselberg 11cacf63f8
Fix #26085
addOrderBy expects a order expression. For the migration scenario we have column objects. Column objects are not supported by quoteColumnName yet.

A column object as order expression is most likely an edgy thing when migration database information.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2021-06-08 16:30:44 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Roeland Jago Douma 14ee17e5c5
Revert "add a prefix index to filecache.path" 2021-04-08 10:09:13 +07:00
Morris Jobke ab48d5e8cb
Cleanup unneeded code around database.xml
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-03-24 22:15:44 +07:00
Joas Schilling bb0c50717c
Bye bye database.xml
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-24 20:04:12 +07:00
Robin Appelman b28f0a0e94
add a prefix index to filecache.path
The reason that `filecache.path` hasn't had an index added is the mysql limitation of ~1kb for indexeded fields,
which is to small for the `path`, however mysql supports indexing only the first N bytes of a column instead of the entire column,
allowing us to add an index even if the column is to long.

Because the index doesn't cover the entire column it can't be used in all situations where a normal index would be used, but it does cover the `path like 'folder/path/%'` queries that are used in various places.

Sqlite and Postgresql don't support prefix indexes, but they also don't have the 1kb limit and DBAL handles the differences in index creation.

Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-19 18:52:25 +07:00