To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 3165
3164  |  3166
Subject: 
Re: Gallery speed
Newsgroups: 
lugnet.off-topic.geek
Date: 
Fri, 6 Jul 2001 01:02:53 GMT
Viewed: 
242 times
  
Kevin Loch wrote in message ...
here's the "slow" query that is currently limiting performance:

SELECT DISTINCT file_parent FROM files ORDER BY file_modify_time DESC LIMIT
24

omitting the DISTINCT above causes it to return instanly but with many
duplicates, since there is often more than one new image per folder.

Might be quicker to do it in 2 stages, first the line above without the
DISTINCT into a cursor, then do a SELECT DISTINCT from that.

SELECT file_parent FROM files ORDER BY file_modify_time DESC into cursor
temp
SELECT DISTINCT file_parent FROM temp LIMIT 24

Kevin
-----------------------------------------------------------------------
Craftsman Lego Kits & Custom models: http://www.lionsgatemodels.com
Brickbay Lego parts store: http://www.brickbay.com/store.asp?p=Kevinw1
eBay Lego auctions: http://members.ebay.com/aboutme/kevinw1/
The Guild of Bricksmiths: http://www.bricksmiths.com
Personal Lego Web page:
http://ourworld.compuserve.com/homepages/kwilson_tccs/lego.html



Message has 1 Reply:
  Re: Gallery speed
 
(...) This probably wouldn't help much - the cursor isn't indexed, so the SELECT DISTINCT would be slow. A better way to split it (assuming your back-end has a decent optimiser) may be to create an index on file_parent + file_modify_time, then do: (...) (23 years ago, 6-Jul-01, to lugnet.off-topic.geek)

Message is in Reply To:
  Gallery speed
 
I think I've fixed the painfully slow performance of the "recent" page. There were some indexes missing in the database that really should have been there. It loads reasonably fast now (~.8 seconds unless the machine is really busy). If there are (...) (23 years ago, 5-Jul-01, to lugnet.general, lugnet.off-topic.geek)

7 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR