homepage Welcome to WebmasterWorld Guest from 54.226.192.202
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 / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Query on a column with a lot of content
turbohost

10+ Year Member



 
Msg#: 1847 posted 1:13 pm on Oct 7, 2003 (gmt 0)

Hi,

I'm rather new to php and mysql. I've got to make a query on about 150.000 records. Each of these records has a number, a title, some more information and a field with a lot of text (sometimes more than 500 characters per field). How do I make a query on these large fields via PHP? I guess that it will take a long while to query all these fields. Are there tricks to make this query faster?

Turbohost

 

mogwai

10+ Year Member



 
Msg#: 1847 posted 1:22 pm on Oct 7, 2003 (gmt 0)

Not sure exactly what you are looking for but take a look at MySQL full text search.

[mysql.com...]

Using the MATCH() function you can quickly search these fields if they are FULLTEXT indexes.

sun818

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 1847 posted 4:22 pm on Oct 7, 2003 (gmt 0)

Of the 150,000 records, do you need to retrieve all of them? Or just a subset? I'd probably build an index on "number" to make the query faster. Then use a query like the one below, where the indexed field is the first field you use in your where clause:

select number, title, more_info, text_field where number = 'yourqueryvalue'

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
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