SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    May 2006
    Posts
    436
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Working and searching large amounts of text

    From what I understand, VARCHAR columns are stored in the row and TEXT columns aren't. In reality how much does this affect performance? What are good practices for storing large amounts of text in MySQL. Specifically:

    1. If you're not selecting TEXT columns, will you receive any hit in performance?
    2. If you had a small string stored both in TEXT and LARGETEXT, do they take up the same amount of memory (i.e. they aren't like CHAR fields that are fixed in size)?
    3. On a FULLTEXT search, would having LARGETEXT when TEXT would do affect performance much? I'm assuming it won't since the query is on the index, not the column (unless you're selecting the column)
    4. On both LIKE and FULLTEXT search, is it better to have NULL over an empty string for rows with nothing to search?


    Thanks.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,274
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    1. no, it will go faster
    2. i believe the answer is yes, they are truncated to fit the data
    3. you're right, no
    4. i don't think it makes a difference
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Evangelist
    Join Date
    May 2006
    Posts
    436
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thanks again.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •