Again, could you please stop posting coding suggestions from AI sources (Grok, CloudFlare AI, etc)... AI sources don't have access to the entirety of the code base to make worthwhile suggestions, we have the same tools to run directly on the stock builds without any 3rd party additions to HTML or PHP coding (either added by a user, developer, or 3rd party tools such as CloudFlare which inject HTML into pages); we regularly run the product through our own IDE tools.

UBB.threads has had had FULLINDEX searches for eons, enable it in your Control Panel (see the attachment) if it is a feature that you would like to use.

The reason it's a slow query during a search is because it's trolling through your hundreds of thousands of posts looking for the search query, it only has impact to the user performing the search.

A search will query all "post_default" cells relating to a Post or Topic (and not the "every single row in the db" as your post claims) as they contain the contents of a post.

Examining the query you're posting about:
Code
SELECT p.POST_ID
FROM
{$config_POSTS AS p
LEFT JOIN {$config_POSTS AS pp ON p.POST_ID = pp.POST_ID,
{$config_TOPICS AS t
WHERE
p.POST_IS_APPROVED = '1'
AND t.TOPIC_STATUS <> 'M'
AND t.FORUM_ID IN ('1','2','3','4','5','39','7','9','10','11','85','13','14','15','16','17','18','19','20','21','22','91','90','24','26','27','28','29','30','95','33','38','35','36','40','88','45','68','65','54','52','49','55','50','51','53','56','58','60','61','72','89','69','71','73','74','75','76','77','78','81','86','93','92','94')
AND p.TOPIC_ID = t.TOPIC_ID
AND (   (LOWER(p.POST_SUBJECT) LIKE LOWER('%spare lock%') OR LOWER(p.POST_DEFAULT_BODY) LIKE LOWER('%spare lock%')))
ORDER BY p.POST_POSTED_TIME DESC
LIMIT 400;
- Searches the _POSTS table and the _TOPICS table (left join)
- Where the post is approved, the topic status isn't "M" (Moved, vs C/Closed), that is in any open forum you have
- It then grabs the topic id that matches the post id
- it then searches the subject and default post body fields for your query "spare lock"
- it then orders the results via the last posted time
- and finally we limit the query to 400 results.
Attachments
image.png


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!