Skip to content

Do not count all table rows if start offset is 0#9162

Merged
roland-d merged 1 commit intojoomla:stagingfrom
csthomas:skipgettotalon0
May 16, 2016
Merged

Do not count all table rows if start offset is 0#9162
roland-d merged 1 commit intojoomla:stagingfrom
csthomas:skipgettotalon0

Conversation

@csthomas
Copy link
Copy Markdown
Contributor

@csthomas csthomas commented Feb 19, 2016

A little speed up backend -> com_content -> articles view when you have set page 1 (means start=0).

How to test:

  • enable joomla debug (list of sql queries)
  • test without patch number queries
  • test with patch number of queries (one count less)

@brianteeman
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 881f44e

I can confirm with this patch there is one less query BUT I really dont know enough about this to understand if there can be other consequences


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9162.

@csthomas
Copy link
Copy Markdown
Contributor Author

Thanks,

I created that patch some time ago, probably for 3.4.4 and
today I try to show this duplicated query but it missing now.

After joomla 3.4.5 this patch do not change too much.
Anyway can be useful to not run getTotal() if not needed.

@grhcj
Copy link
Copy Markdown

grhcj commented Feb 19, 2016

I have tested this item ✅ successfully on 881f44e


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9162.

@joomla-cms-bot
Copy link
Copy Markdown

This PR has received new commits.

CC: @brianteeman, @grhcj


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9162.

@csthomas
Copy link
Copy Markdown
Contributor Author

csthomas commented Mar 9, 2016

New commit have not change anything, I only rebase to newer stagging branch.

  • Method getStart() always run getTotal(), but when $start is 0 then calculating $start won't change anything, because $start can not be less than 0.
  • I think that the patch will be useful for sort queries in order (select from table, select count)
    when start=0 (first page)
  • In the future - joomla should not run getTotal() at all if number of fetched rows is less than limit from query and $start is 0. Specially when there is a lots of filters and result contains only a few rows.

@brianteeman
Copy link
Copy Markdown
Contributor

RTC (maintainer the tests were before a rebase so it should be ok)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9162.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 11, 2016
@brianteeman brianteeman added this to the Joomla 3.6.0 milestone May 11, 2016
@roland-d roland-d merged commit 56068d5 into joomla:staging May 16, 2016
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 16, 2016
@roland-d
Copy link
Copy Markdown
Contributor

Thanks everybody

@csthomas csthomas deleted the skipgettotalon0 branch September 7, 2016 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants