Sackgesicht VIP
Total posts: 1,636
25 Dec 2015 08:05

The section parameter "Do you have unpublished records?" became obsolet with method CStatistics::hasUnPublished.

On the other hand, if we purely rely on the section parameter and change CStatistics::hasUnPublished, we can get rid of 1 SQL query per list page and more importantly we can remove the idx_published index. #__js_res_record has too many indices anyway, which slows down encoding/updating/importing of records. I believe this index will only be chosen for this particular query in CStatistics::hasUnPublished.

A nice function for this section parameter would be a check and indicator if unpublished records exist (even display a list for quick access to either delete or publish them again if needed)

Last Modified: 05 Jan 2016


Sergey
Total posts: 13,748
29 Dec 2015 08:35

I do not think this one query is a problem. My concern here is unexpected behavior. For example user selected I have no unpublished records but he has or he hasnot but he did not select and do not know that it could be little bit faster.

I think only one query per section will not change much. ANd I think we can deleet idx_published even with this query and section_id will be used.


Sackgesicht VIP
Total posts: 1,636
02 Jan 2016 06:21

This 1 query is not really a problem.

There is more behind this query, optimizing Cobalt and rethinking the way it works. Cobalt 8 is an evolution of several versions and still carries code from mighty resoures along.

First, if you solely rely on the CStatistics::hasUnPublished method, there is no need to have the section parameter "Do you have unpublished records" since it has no functionality anymore. Another issue is the number of indices on js_res_record. I deleted some of them which we dont need for sorting, sincce it affected the encoding. Just with 4-5 people encoding at the same time we experienced a massive slowdown with all the indices active. Maybe the next Cobalt version should come only with essential indices enabled by default and dynamically add additional when the need arrises.

Suggestion for now: Either delete or keep the index but use the section parameter to "override" the CStatistics::hasUnPublished method. Default parameter is "YES". If admin changes it to "NO", the query will not be executed. Nice would be an indicator to the parameter if unpublished records exist for the section.

2016-01-02_14-09-25


Sergey
Total posts: 13,748
05 Jan 2016 06:43

Sackgesicht Default parameter is "YES". If admin changes it to "NO", the query will not be executed.

Done.

Sackgesicht Nice would be an indicator to the parameter if unpublished records exist for the section.

Good idea. Although that would require create custom form element. I'll see may be I add it to Cobalt 9.


Sackgesicht VIP
Total posts: 1,636
05 Jan 2016 07:58

Sergey Done.

Excellent ....

"It's the little details that are vital. Little things make big things happen." John Wooden

PS: Anything on the "1st query removal" child field issue (validation through 2nd query) in skype?

Powered by Cobalt