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
Updating $page->parent extremely slow; Sometimes selector 'has_parent' is not working #1297
Comments
Another thought on this topic - I guess this error appears after Ryan changed some behaviour dealing with page parents. Since a long time we would love to upgrade to the latest version, but because of this bug it is just not possible for us. In the latest ProcessWire version are many features we currently cannot use. We really hope this issue gets fixed soon or this config-setting would be an option. This issue was posted 3 months ago and we would highly appreciate any feedback on this. Thank you! |
@dennisspohr It is essentially an index of every page that has children. This part of the code was rewritten because the previous version had some issues that caused it to be sometimes unreliable. Now it is reliable, and should be faster most of the time as well, but part of the reason it is more reliable is that it recreates larger portions of the index in some cases. Some parent changes can affect other parent changes, so it can have to rewrite large portions of the index depending on the case. The index isn't technically necessary for anything other than to fulfill "has_parent=..." portions of a selector. So if you don't need "has_parent" in your selectors, then it would be okay to turn this index off. Let me know if that would help in your case and I can add a setting to disable that index. |
@ryancramerdesign The point is, that in our case the code is getting extremely slow. I guess there should be a better solution. We are using the has_parent-Selector quite often, so removing this is unfortunately no option for us. |
Could it be possible to turn the index off for the time to move a big amount of pages under a new parent and then turn it back on and have the system recalculate the index once again? |
@ryancramerdesign Are there any updates on this? Unfortunately we have increased problems with the performance. There are new interesting features that could help us to deal with it, but because of this issue mentioned above we are still stuck on version 3.0.148.
By now we have 9,3 million entries in the pages-table. I have opened this issue more than 2 years ago and I really hope we can find a suitable solution together. |
@dennisspohr This is an issue I've not been able to duplicate and have not had other reports of either. Using the original example of I also wanted mention there's a hook you can use to bypass the update of the pages_parents table on a parent change. For instance, it's likely not necessary for you to keep track of parents for repeater pages (if you are using them) so you can tell it to skip over updating the pages_parents table for repeaters, as one example:
|
…rocesswire-issues#1297 by rewriting code that builds pages_parents table and requires fewer changes to the table. This is called on page parent changes and clone operations. Needs further testing on installation with 1+ million pages to compare with previous and confirm performance improvement while maintaining same accuracy.
@dennisspohr See the attached commit above for an attempted fix for this issue. |
Works! |
Short description of the issue
3 weeks ago we upgraded ProcessWire from 3.0.148 to 3.0.165. Since then we had problems quite randomly when using $page->find(); We figured out that the same selector was working with $pages->find() - therefore the selector "has_parent" was not working. The issue was happening just some times and was always resolved after a few minutes, without us doing anything. It looks like there's missing data in the pages_parents table and somehow it's getting fixed by the system after some time.
Additionally changing the parent of a page was getting extremely slow. The following codes took 20-30 seconds:
$page->of(false);
$page->parent = $anotherpage.
$page->save();
We switched back to Processwire 3.0.148 and since then we don't have these issues anymore.
Setup/Environment
Additional details
Our database is quite large:
Thread
https://processwire.com/talk/topic/24848-change-of-page-parent-is-extremely-slow/
The text was updated successfully, but these errors were encountered: