Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8536213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:36:39+00:00 2026-06-11T10:36:39+00:00

Say you have a TEXT column on your table which could either be huge

  • 0

Say you have a TEXT column on your table which could either be huge / paragraph long rants, or only a few sentence long lines.

Performance wise / server load wise, is it better to do:

SELECT SUBSTRING( myTxtColumn, 1, 200) FROM myTable AS myTxtColumn

Or to do:

SELECT myTxtColumn FROM myTable

Which of the queries puts more load on the server?

I’m curious if it will be easier for the server to fetch the full value of the column than doing a SUBSTRING() on it, or if the SUBSTRING() will be easier since its only returning the first 200 chars rather than the several KB long text values.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:36:40+00:00Added an answer on June 11, 2026 at 10:36 am

    I’d err on the side of caution and use the substring. Your first query may need to read the whole string before doing substring on it (I suspect mysql is smarter than that, but who knows). Your second query definitely has to read the whole string and send it over the network.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have a text box which should have a default value.... and
Let's say I have a text file that is 100 lines long. I want
I have two tables. Lets say they look like this Table Sports: Column 1:
Let's say I have a table column with 10 rows, each with <td id=num>
Say I have this query: SELECT name::text, id::int, pass:bool FROM mytable; which gives me
Assume I do not have text indexing on. Let say I have: SELECT *
Let's say I have a text file of basic mathematical functions. I want to
Say I have the following text ..(content)............. <A HREF=http://foo.com/content >blah blah blah </A> ...(continue
Lets say I have if (textbox.Text != null && textbox.Text.Length > someNum) { //some
Let's say I have some original text: here is some text that has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.