Skip to content
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

lib.tx_news makes unneccessary queries #1579

Closed
DavidBruchmann opened this issue Sep 18, 2021 · 8 comments
Closed

lib.tx_news makes unneccessary queries #1579

DavidBruchmann opened this issue Sep 18, 2021 · 8 comments

Comments

@DavidBruchmann
Copy link

Feature Request

Is your feature request related to a problem? Please describe.
lib.tx_news makes unneccessary queries about objects that are known already.
The queries seem being required to provide rendering based on tt_content.

Describe the solution you'd like
I'd like a solution that is using known data to avoid the additional database-queries.

Describe alternatives you've considered
I've no solution yet.

Teachability, Documentation, Adoption, Migration Strategy
Older templates could optionally adjusted but would work without too (just without the small gain of speed and memory).
The solution would require a change in tx_news itself and should be documented, so that older templates and TypoScript could be adjusted.

@georgringer
Copy link
Owner

thanks for your report. so what should I do? I opt for still closing the issue

@DavidBruchmann
Copy link
Author

yes, just looking on all the queries in the admPanel, but I never see another smart option.
So it seems being necessary.

@DavidBruchmann
Copy link
Author

@froemken maybe you have here an idea?

@froemken
Copy link
Contributor

froemken commented Jun 6, 2024

@DavidBruchmann I have just opened that issue here: #2490
Regardless, if pagebrowser is activated or not, the listAction executes at least two COUNT queries and of cause the pages queries for each next/prev link in fluid template. There is a clone of the used query (see getQuery()) that's why it is called twice. In one of our project we have 20 news plugin on one page which results into 3.800 queries. Most are for tx_news_domain_model_news and pages tables. Currently, I'm unsure, but maybe the paginator creates a lot of these queries. Without all these plugins we have ~300 queries. If I got the OK from customer I will investigate more time.

@DavidBruchmann
Copy link
Author

I read that issue, therefore I got the idea you had a fix in mind here too perhaps 😆

@DavidBruchmann
Copy link
Author

The issue is that in the templates content is created again by TypoScript sometimes, so it's not primarily related to the count issue.

This might be a good example, to show the issue, the data are known there already:

<f:if condition="{newsItem.contentElements}">
<!-- content elements -->
<f:cObject typoscriptObjectPath="lib.tx_news.contentElementRendering">{newsItem.contentElementIdList}</f:cObject>
</f:if>

@georgringer georgringer reopened this Jun 10, 2024
@DavidBruchmann
Copy link
Author

DavidBruchmann commented Jun 10, 2024

so a fix could include one of these options, or perhaps another solution:

  1. tell cObject FLUIDTEMPLATE (from lib.contentelement / tt_content) to render existing data instead of making a new query (how ?), would this be a core-challenge?
  2. use an own (intermediate ?) DataProcessor
  3. assign tt_content to the data (like 1 but assignment in viewhelper instead of TypoScript-Object, comparable with renderObj = < tt_content in CONTENT or parseFuncTSPath in the f:format.html viewhelper)

I haven't made any tests yet, but perhaps these ideas help a bit. Ideas might be still messed up, and need some more focussing.

@georgringer
Copy link
Owner

I am closing the issue as no progress done and really not easy to solve

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

No branches or pull requests

3 participants