Ad Widget

Collapse

When to use text vs character item type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mucknet
    Member
    • Dec 2004
    • 59

    #1

    When to use text vs character item type

    Hi --

    Historically I haven't done much with text/character item types, but I recently had a need, and was unsure which to pick. Is there a guide available?

    I know that character item types are limited to 255 bytes (a byte translating roughly to a character, including whitespace). Is there any difference in the way they're stored in zabbix that makes one more performance friendly? Or any other differences I should consider? If my string will fit into 255 characters, is there any reason at all to use the "text" type?

    Thanks!
  • mucknet
    Member
    • Dec 2004
    • 59

    #2
    Bueller?..... Bueller?....

    Comment

    • violatohr
      Junior Member
      • Jul 2014
      • 13

      #3
      would love to see an answer to this!

      yeah, I'm having distinct problems with the formatting of "STRING" values coming back from SNMP polls; so, I would love to know what the significance/features of each is...

      Comment

      • emmanux
        Member
        Zabbix Certified Specialist
        • Mar 2013
        • 47

        #4
        Character - character (string) data limited to 255 bytes
        Text - text of unlimited size
        That's all, I thought.

        Comment

        • Crypty
          Member
          • Jul 2012
          • 80

          #5
          And what about the database size? If I have 20 letters in the value. Will it have the same size with character and text variable or not?

          Comment

          • kaluq
            Junior Member
            • Jul 2016
            • 7

            #6
            Bumping this because it still hasn't received an answer. My question is "When is it ever useful to use character item type when text item could do the same thing without any limit?"

            Comment

            • emmanux
              Member
              Zabbix Certified Specialist
              • Mar 2013
              • 47

              #7
              Originally posted by Crypty
              And what about the database size? If I have 20 letters in the value. Will it have the same size with character and text variable or not?

              In MySQL, TEXT and BLOB is stored off the table with the table just having a pointer to the location of the actual storage.

              VARCHAR is stored inline with the table. VARCHAR is faster when the size is reasonable, the tradeoff of which would be faster depends upon your data and your hardware, you'd want to benchmark a realworld scenario with your data.

              Source: http://stackoverflow.com/questions/2...archar-vs-text

              Comment

              • kaluq
                Junior Member
                • Jul 2016
                • 7

                #8
                Originally posted by emmanux
                In MySQL, TEXT and BLOB is stored off the table with the table just having a pointer to the location of the actual storage.

                VARCHAR is stored inline with the table. VARCHAR is faster when the size is reasonable, the tradeoff of which would be faster depends upon your data and your hardware, you'd want to benchmark a realworld scenario with your data.

                Source: http://stackoverflow.com/questions/2...archar-vs-text
                Thank you, that was an itch badly in need of a scratch.

                Comment

                Working...