Ticket #398 (closed enhancement: fixed)

Opened 5 years ago

Last modified 15 months ago

Avoid use of LoadAllPages() and remove this method

Reported by: DotMG Owned by: DotMG
Priority: normal Milestone: 1.3.1
Component: core Version: 1.2-p1
Severity: normal Keywords: optimization database
Cc:

Description (last modified by JavaWoman) (diff)

LoadAllPages() uses a lot of RAM if there is a large number of big size pages. The unused LoadPageTitles() method is a good candidate to replace it.


Related tickets #75 #117

Change History

  Changed 5 years ago by DotMG

  • status changed from new to assigned

  Changed 5 years ago by DotMG

  • status changed from assigned to closed
  • resolution set to fixed

Done in [260] The method LoadAllPages() was not removed because there may be some wikka customization using this method. Maybe, we could replace it by an alert saying it's deprecated?

follow-up: ↓ 8   Changed 5 years ago by JavaWoman

  • status changed from closed to reopened
  • resolution fixed deleted

The LoadpagesByOwner() function is a great idea, but in my testing (profiling the time taken for the action) it doesn't actually make much of a difference in speed (though it could be more pronounced with very many pages). However by adding an index on the owner column I suddenly see a 10-fold speed increase - I expected some, but not that much! Obviously, this would need a DDL change in the installer.

Other observations:
- using GetUserName() as parameter is slightly inefficient since $username? is already available by checking for logged in user: this can be used directly
- adding DISTINCT (more efficient) and ORDER BY tag (sorted result, like in LoadAllPages) to the query also helps - the latter is actually needed since the action counts on this order to format the output.

Reopening this...

  Changed 5 years ago by JavaWoman

  • component changed from 3rdparty to core

  Changed 5 years ago by JavaWoman

In [589] the call in the mypages action has been changed to use $user['name'] instead of $this->GetUserName().

  Changed 5 years ago by JavaWoman

  • description modified (diff)

  Changed 5 years ago by JavaWoman

  • version set to 1.1.7

in reply to: ↑ 3   Changed 5 years ago by JavaWoman

Replying to JavaWoman:

Other observations:
- using GetUserName() as parameter is slightly inefficient since $user['name'] is already available by checking for logged in user: this can be used directly
- adding DISTINCT (more efficient) and ORDER BY tag (sorted result, like in LoadAllPages) to the query also helps - the latter is actually needed since the action counts on this order to format the output.

Query was corrected in [622] in the course of reformatting all queries (warning: long page!).

That leaves the index to be added (to be tackled in installer #97)

  Changed 4 years ago by DotMG

(In [928]) Creating index on field owner to accelerate queries for method LoadPagesByOwner().

refs #398, #97

  Changed 4 years ago by DotMG

  • status changed from reopened to closed
  • resolution set to fixed

  Changed 3 years ago by DarTar

  • milestone changed from 1.2 to 1.3

Retargeting to 1.3, this ticket has already been closed in trunk, from which 1.3 will be branched. Consider backporting urgent issues to 1.2.X

  Changed 2 years ago by BrianKoontz

  • status changed from closed to reopened
  • resolution fixed deleted

  Changed 2 years ago by BrianKoontz

  • owner changed from DotMG to BrianKoontz
  • status changed from reopened to assigned
  • version changed from trunk to 1.2-p1

  Changed 2 years ago by BrianKoontz

(In [1544]) Ported [260] from trunk to 1.3. Refs #398, #912.

  Changed 2 years ago by BrianKoontz

(In [1545]) Ported [928] from trunk to 1.3. Refs #398, #912.

  Changed 2 years ago by BrianKoontz

  • status changed from assigned to testing

  Changed 2 years ago by DotMG

  • status changed from testing to assigned

Testing failed :

I tested the mypages action and I got the error MYPAGES_NOT_LOGGED_IN, although I'm logged in. The cause of this first issue is that $this->registered was introduced in libs/Wakka.class.php, and it isn't initialized when $this->SetUser() is not called.

  Changed 2 years ago by DotMG

  • owner changed from BrianKoontz to DotMG

  Changed 2 years ago by DotMG

(In [1636]) Refs #398

  • In libs/Wakka.class.php, a proper initialization of $this->registered was needed.
  • In actions/mypages/mypages.php : Removed test with $page[owner] , because actually, all items returned by LoadPagesByOwner are pages owned by the user.
  • In lang/en/en.inc.php : Changed "You" to "%s", because MyPages now can list pages owned by a given user (for admin). This change shoud be propagated to other lang.

  Changed 2 years ago by DotMG

  • status changed from assigned to testing

  Changed 2 years ago by DotMG

(In [1637]) refs #398

[928] not correctly ported into 1.3 : added creation of index idx_owner on column `owner' of table _pages

  Changed 2 years ago by BrianKoontz

  • keywords database added

Tagged to indicate database change.

  Changed 2 years ago by BrianKoontz

  • status changed from testing to commit

All checks out here.

  Changed 2 years ago by BrianKoontz

  • status changed from commit to closed
  • resolution set to fixed

  Changed 15 months ago by BrianKoontz

  • milestone changed from 1.3 to 1.3.1

Updated milestone to 1.3.1

Note: See TracTickets for help on using tickets.