Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
Ok, that left join is probably causing some issues. There is a full table scan being done in the search by noting where it says ALL on t2, and the left join is compounding that.

With the latest search engine changes, this mod would probably be better served to run a different type of search query instead of the default one. Maybe one query to grab the latest topics and another to just loop through those and grab the info from the latest posts in those topics. This is probably not the best place to post this, probably be should be in another forum but I can give some tips here that can be continued elsewhere

This basic query would need to be modified to only select from the proper forums, but this would give you the last post and posterid for every topic ordering it so the most recent topics get returned first:

SELECT B_LastPostNum,B_LastPosterId
FROM w3t_Posts
WHERE B_Topic='1'
ORDER BY B_Last_Post DESC

Then you'd just need to loop through the results and grab the actual information for those particular posts. Would make for a quite complex modification I'm sure but on large forums with alot of posts the regular search engine would pretty much die as it's doing now on your forums.

Actually if you don't mind giving the subject of the topic itself instead of the last post in the topic, this query should do what you are looking for...

SELECT t1.B_LastPostNum, t1.B_Main , t3.U_Username , t1.B_Subject , t1.B_Posted , t1.B_Board , t3.U_Color , t1.B_Reged , t1.B_Icon , t2.Bo_Title , t2.Bo_Read_Perm , t2.Bo_Cat , t1.B_Posterid , t1.B_Status , t1.B_AnonName , t1.B_Body FROM w3t_Posts AS t1 , w3t_Boards AS t2 , w3t_Users AS t3 WHERE t1.B_Topic='1' AND t1.B_Approved = 'yes' AND t1.B_Board = t2.Bo_Keyword AND t1.B_LastPosterId = t3.U_Number AND t1.B_Status <> 'M' AND t1.B_Board IN ('UBB1' , 'UBB2' , 'UBB4' , 'UBB5' , 'UBB6' , 'networking' , 'danews' , 'construction' , 'soho' , 'reviews' , 'security' , 'win2k' , 'unix' , 'test' , 'ports' , 'info' , 'mobile' , 'feedback' , 'photos' , 'unreg' , 'swap' , 'change' , 'help' , 'deals' , 'article' , 'software') AND ( (t1.B_Subject LIKE '%%' OR t1.B_Body LIKE '%%')) ORDER BY t1.B_Last_Post DESC LIMIT 26

That eliminates the last join and only returns one entry per topic. Ok, like I said, that's something to go on

Last edited by Scream; 12/18/2003 11:17 AM.

UBB.threads Developer
Sponsored Links
Entire Thread
Subject Posted By Posted
Anyone running 6.4 Rick 12/11/2003 7:02 AM
Re: Anyone running 6.4 scroungr 12/11/2003 7:56 AM
Re: Anyone running 6.4 Zarzal 12/11/2003 10:48 AM
Re: Anyone running 6.4 AllenAyres 12/11/2003 7:33 PM
Re: Anyone running 6.4 Rick 12/11/2003 8:07 PM
Re: Anyone running 6.4 Rick 12/13/2003 9:37 PM
Re: Anyone running 6.4 Zarzal 12/14/2003 12:56 AM
Re: Anyone running 6.4 Rutto 12/15/2003 10:53 PM
Re: Anyone running 6.4 Rutto 12/15/2003 11:15 PM
Re: Anyone running 6.4 Zarzal 12/15/2003 11:36 PM
Re: Anyone running 6.4 Rutto 12/16/2003 12:04 AM
Re: Anyone running 6.4 Dalantech 12/17/2003 9:46 AM
Re: Anyone running 6.4 Rick 12/17/2003 5:59 PM
Re: Anyone running 6.4 AKD96 12/17/2003 7:41 PM
Re: Anyone running 6.4 JoshPet 12/17/2003 9:11 PM
Re: Anyone running 6.4 AKD96 12/17/2003 9:34 PM
Re: Anyone running 6.4 Dalantech 12/18/2003 3:39 PM
Re: Anyone running 6.4 Rick 12/18/2003 7:07 PM
Re: Anyone running 6.4 omegatron 12/18/2003 7:12 PM
Re: Anyone running 6.4 Rick 12/18/2003 7:17 PM
Re: Anyone running 6.4 omegatron 12/18/2003 7:26 PM
Re: Anyone running 6.4 Dalantech 12/18/2003 10:37 PM
Re: Anyone running 6.4 omegatron 12/18/2003 11:29 PM
Re: Anyone running 6.4 Dalantech 12/20/2003 9:27 AM
Re: Anyone running 6.4 Gregori 12/23/2003 12:27 PM
Re: Anyone running 6.4 omegatron 12/23/2003 3:46 PM
Re: Anyone running 6.4 Gregori 12/23/2003 4:45 PM
Re: Anyone running 6.4 omegatron 12/23/2003 4:51 PM
Re: Anyone running 6.4 coloradok5 12/23/2003 7:11 PM
Re: Anyone running 6.4 coloradok5 12/23/2003 7:37 PM
Re: Anyone running 6.4 coloradok5 12/23/2003 11:13 PM
Re: Anyone running 6.4 Gregori 12/24/2003 3:40 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
• Shock Hosting
• Stable Host
• bluehost
• InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,080
Joined: March 2000
Forum Statistics
Forums63
Topics37,583
Posts293,957
Members13,826
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 34299
Topics Created 0
Posts Made 0
Users Online 1
Birthdays 1
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
isaac 2
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20261026)