Advertisement:

Author Topic: [SMF 2.1 RC2] Queries with attachments in the message  (Read 456 times)

Offline Massl

  • Jr. Member
  • **
  • Posts: 260
[SMF 2.1 RC2] Queries with attachments in the message
« on: April 23, 2019, 04:15:54 PM »
Hi, I created a new topic with 10 images attached, is it normal that every time 97 queries are generated to display the discussion with only one message?
Default theme and language, no mod.

Thanks

Offline albertlast

  • Development Contributor
  • Full Member
  • *
  • Posts: 589
Re: [SMF 2.1 RC2] Queries with attachments in the message
« Reply #1 on: April 24, 2019, 02:35:57 AM »
For rc2  is this behavior normal,
The next release got some optimizations to reduce the amount of queries.

Related issue: https://github.com/SimpleMachines/SMF2.1/issues/5492

Offline Massl

  • Jr. Member
  • **
  • Posts: 260
Re: [SMF 2.1 RC2] Queries with attachments in the message
« Reply #2 on: April 24, 2019, 03:59:17 AM »
For rc2  is this behavior normal

I didn't know, thanks.
I noticed it now because it occurs only when the attachments are inserted in the text of the message with
Code: [Select]
[attach id=xxx]test.png[/attach]If I don't use inline attachments the queries decrease from 97 to 35.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,626
    • StoryBB/StoryBB on GitHub
Re: [SMF 2.1 RC2] Queries with attachments in the message
« Reply #3 on: April 24, 2019, 05:32:05 AM »
Even 35 is unreasonable when in 2.0 it took 1 query to get the attachments for the entire page.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline albertlast

  • Development Contributor
  • Full Member
  • *
  • Posts: 589
Re: [SMF 2.1 RC2] Queries with attachments in the message
« Reply #4 on: April 24, 2019, 06:41:00 AM »
Well i got the pr running how reduce the amount of queries to one.
https://github.com/SimpleMachines/SMF2.1/pull/5615

When you want to test this,
a small warning:
Please had in mind that this changes are build around the existing changes of the next release are made.
So to take only the changes could create issue (you should at least all related pr add too).

Offline Massl

  • Jr. Member
  • **
  • Posts: 260
Re: [SMF 2.1 RC2] Queries with attachments in the message
« Reply #5 on: April 24, 2019, 04:44:56 PM »
Well i got the pr running how reduce the amount of queries to one.
https://github.com/SimpleMachines/SMF2.1/pull/5615

I have modified the files and queries decrease from 97 to 20  :laugh:
A topic without attachments takes 19 queries, great job thanks!

EDIT: I do not understand...
If I use the global moderator account the queries arrive at 70, I think there is another problem ...

Global moderator 70 queries, normal user 19 queries, admin 20 queries  ???


« Last Edit: April 24, 2019, 04:57:50 PM by Massl »

Offline albertlast

  • Development Contributor
  • Full Member
  • *
  • Posts: 589
Re: [SMF 2.1 RC2] Queries with attachments in the message
« Reply #6 on: April 24, 2019, 06:42:21 PM »
Like i said ther are 3 pr related to this issue,
you should apply all of them.