Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add item_source index #29587

Merged
merged 1 commit into from
Dec 6, 2017
Merged

add item_source index #29587

merged 1 commit into from
Dec 6, 2017

Conversation

butonic
Copy link
Member

@butonic butonic commented Nov 15, 2017

EXPLAIN SELECT * FROM `oc_share` WHERE `item_source` = '1410';
+------+-------------+----------+------+---------------+------+---------+------+------+-------------+
| id   | select_type | table    | type | possible_keys | key  | key_len | ref  | rows | Extra       |
+------+-------------+----------+------+---------------+------+---------+------+------+-------------+
|    1 | SIMPLE      | oc_share | ALL  | NULL          | NULL | NULL    | NULL | 2998 | Using where |
+------+-------------+----------+------+---------------+------+---------+------+------+-------------+
1 row in set (0.00 sec)

CREATE INDEX item_source_index ON oc_share (item_source);
Query OK, 0 rows affected (0.09 sec)
Records: 0  Duplicates: 0  Warnings: 0

EXPLAIN SELECT * FROM `oc_share` WHERE `item_source` = '1410';
+------+-------------+----------+------+-------------------+-------------------+---------+-------+------+-----------------------+
| id   | select_type | table    | type | possible_keys     | key               | key_len | ref   | rows | Extra                 |
+------+-------------+----------+------+-------------------+-------------------+---------+-------+------+-----------------------+
|    1 | SIMPLE      | oc_share | ref  | item_source_index | item_source_index | 768     | const |    1 | Using index condition |
+------+-------------+----------+------+-------------------+-------------------+---------+-------+------+-----------------------+
1 row in set (0.00 sec)

or more visually:

6d6184662f97bf8dd753c3c1a8d82e83249ba075645632b752 pimgpsh_fullsize_distr

index added at 15:45

@codecov
Copy link

codecov bot commented Nov 15, 2017

Codecov Report

Merging #29587 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #29587      +/-   ##
============================================
- Coverage     61.78%   61.77%   -0.01%     
- Complexity    17482    17484       +2     
============================================
  Files          1047     1048       +1     
  Lines         57714    57717       +3     
============================================
  Hits          35657    35657              
- Misses        22057    22060       +3
Impacted Files Coverage Δ Complexity Δ
...aring/appinfo/Migrations/Version20171115154900.php 0% <0%> (ø) 2 <2> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a8a50de...c0e2327. Read the comment docs.

@butonic
Copy link
Member Author

butonic commented Nov 16, 2017

@DeepDiver1975 backport to 10 in #29592

@DeepDiver1975
Copy link
Member

there is no coverage on the migrations ... this is because they are executed on installation where no coverage is collected.

@PVince81 @butonic general question: shall we exclude migrations from coverage?

@butonic
Copy link
Member Author

butonic commented Nov 27, 2017

@patrickjahns any ideas for testing migrations with your docker toobox?

@patrickjahns
Copy link
Contributor

patrickjahns commented Nov 27, 2017

What do you want to test?
Upgrading owncloud, or if migrations are successfully executed?

If the later - I've only seen database migration tests when we based our projects on doctrine migrations.
Wet let the migrations execute, and them compare if schema:update would still detect changes / differences between database and entity model. (Assuming developers populated their migrations properly and they we're in sync with the entities).

Since we don't have this luxury currently - we might need to discuss how/when we want to test migrations.
Guess best approach would be, to have a pre-migration schema/dump and a post-migration schema/dump and compare if executing the migration would result in the desired effect?

Thinking further - I had to compare databases at a customer recently, since some migrations did not run (for no known reasons) - it would anyhow be great to have a 'final' schema (for core tables) we could test against after/during a upgrade. So we known early enough if anything went wrong and ask users to rollback their backup if something went wrong

@tomneedham
Copy link
Contributor

What do you want to test?

a lot of the time its just checking that nothing explodes on the various matrices of db platforms - since by default we dont run these in tests automagically

@DeepDiver1975 DeepDiver1975 merged commit 57d017b into master Dec 6, 2017
@DeepDiver1975 DeepDiver1975 deleted the add_item_source_index branch December 6, 2017 09:08
@lock
Copy link

lock bot commented Aug 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants