homepage Welcome to WebmasterWorld Guest from 54.205.189.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
Archiving old records with another index ?
Seregwethrin




msg:4081664
 11:02 pm on Feb 16, 2010 (gmt 0)

Hello;

I have something in my mind for better performance, but i don't know if we can implement it with mysql.

For example I've a forum with hundreds of thousands of posts and I want to mark entries that is less than 1 year old as "hot". And when I send a SELECT query I want mysql to search first in "hot" indexes, if not found than search non-hot indexes.

So with that the posts more than 1 year old ones will be searched faster. they are already the most selected ones.

It's like archiving old posts with an another index.

But I don't want to change sql queries, just want to modify the table, database or indexes.

Is it possible?

 

whoisgregg




msg:4103364
 10:13 pm on Mar 23, 2010 (gmt 0)

Unfortunately, this wouldn't be possible. However, just having a properly indexed DATE column would allow you to run two queries, first a search of the last year and then only running a search on older records if the first search failed to turn up enough records.

Seregwethrin




msg:4103394
 11:21 pm on Mar 23, 2010 (gmt 0)

Thanks

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved