Research and document, where or by what tools the wb_entity_per_page table
- is currently used
- will still be needed
Research and document, where or by what tools the wb_entity_per_page table
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T30599 Deadlock tracking bug (tracking) | |||
Resolved | hoo | T111535 Wikibase\Repo\Store\SQL\EntityPerPageTable::{closure} creating high number of deadlocks | |||
Declined | None | T51982 Add missing wb_entity_per_page entries on LinksUpdate | |||
Invalid | Lydia_Pintscher | T70176 EntityPerPageTable class should be usable from the client | |||
Resolved | • Ladsgroup | T67333 Wikibase\EntityPerPageTable::getItemsWithoutSitelinks slow query with large LIMIT offset | |||
Resolved | Addshore | T114902 Remove numeric entity IDs from database schema | |||
Resolved | • Ladsgroup | T95685 Drop wb_entity_per_page table | |||
Resolved | daniel | T140758 Investigate where wb_entity_per_page table is used and needed |
I have grepped for wb_entity_per_page in our code base, here is the result: https://phabricator.wikimedia.org/P3511
Here is a summary of places where we reference the wb_entity_per_page table, and what should be doen about them:
extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php
SqlEntityInfoBuilder uses wb_entity_per_page to find the page ID and redirect information for a list of EntityIds. This can be done based on the page and redirect tables instead.
extensions/Wikibase/repo/includes/Store/Sql/PropertyInfoTableBuilder.php
PropertyInfoTableBuilder uses wb_entity_per_page to list all properties. This can be done using the page table instead, based on the namespace.
extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageTable.php
This is the big one. We will continue to need some of the me methods defined by the EntityPerPage interfaces, but not others:
The rest can really go:
The remaining of the occurrences of wb_entity_per_page are pointless once the changes above are implemented:
extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageBuilder.php
No longer needed once no code relies on the information from wb_entity_per_page anymore.
extensions/Wikibase/repo/includes/Store/Sql/DatabaseSchemaUpdater.php extensions/Wikibase/repo/sql/Wikibase.sql extensions/Wikibase/repo/sql/AddEntityPerPage.sql extensions/Wikibase/repo/sql/AddEppRedirectTarget.sqlite.sql extensions/Wikibase/repo/sql/AddEppRedirectTarget.sql
When we no longer need the table, it can be removed from Wikibase.sql and DatabaseSchemaUpdater.php. AddEntityPerPage.sql and AddEppRedirectTarget.sqlite.sql can be dropped entirely.
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/EntityPerPageTableTest.php extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/PropertyInfoTableBuilderTest.php extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/EntityPerPageBuilderTest.php extensions/Wikibase/lib/tests/phpunit/Store/Sql/SqlEntityInfoBuilderTest.php
When the code doesn't use the table any more, the tests should obviously also stop using it.
So, we need to change three classes that still need the information from wb_entity_per_page: SqlEntityInfoBuilder, PropertyInfoTableBuilder, and EntityPerPage(Table). Then we can drop references to the table from all other parts of the code, and finally the table itself.
Investigation complete. I suggest to keep this open until we have created tasks for the steps needed to get rid of wb_entity_per_page.
Created tasks based on this investigation: