Picking the right string column datatype - CHAR vs VARCHAR vs TEXT

Поделиться
HTML-код
  • Опубликовано: 28 ноя 2024

Комментарии • 34

  • @Basukinathkr
    @Basukinathkr 10 месяцев назад +5

    Thanks Arpit. I have seen very exerienced people using varchar as a one-size-fits-all approach. They simply put any random number with it and it's done. In an enterprise environment, changing this using some liquibase script or any other approach not only involves lots of re-discussion but also break stuff. This topic of CHAR vs VARCHAR vs TEXT is very much important to understand and implement.

  • @rocksh1234
    @rocksh1234 10 месяцев назад +1

    Arpit, the explanation that you provide is extremely well-designed and in-depth. Its always a treat to watch your videos.
    Since you dive deep into system design concepts, request you to create a solid video on SOLID principles, this would help all levels of engineers.

  • @yash_renaissance_athlete
    @yash_renaissance_athlete 10 месяцев назад +3

    Hi Arpit, great video as usual.
    It would be great if you can create a video about the behind-the-scenes of the disk IO involved with GETting a row (all the jazz around blocks, page seeks, etc.). That would also end up emphasizing and justifying the reason why there’s an additional latency of fetching a long TEXT/VARCHAR from a different page lookup and why DBs prefer to keep their rows short.
    Rest, keep on making such amazing videos.

    • @AsliEngineering
      @AsliEngineering  10 месяцев назад +2

      That is my next video. Adding it here would have made this video an hour long. Next few videos will be about Heap tables and Toast tables.

    • @yash_renaissance_athlete
      @yash_renaissance_athlete 10 месяцев назад

      @@AsliEngineering Thanks a ton. Appreciate it! Will wait eagerly for the next one :)
      My obsidian is filled with the notes of your videos by the way 😂
      Cheers!

  • @dataoil3620
    @dataoil3620 10 месяцев назад

    Thanks Arpit, another great video!
    Just a suggestion to make videos more interestiing,
    1. I think you should use white background without any lines.
    2. Just use 1 or 2 types of inks.
    3. Also I think writing in slides format is better because if someone wants to read on the page, its little confusing to what to look at and where to start from.
    Thanks again.

    • @AsliEngineering
      @AsliEngineering  10 месяцев назад

      Thank you for the suggestion. I tried with typed slides, but that felt more like lecture and less like a video. Plus here I can scribble and doodle.
      But point taken, let me make some alterations.

  • @dhruvgarg722
    @dhruvgarg722 10 месяцев назад +1

    We can also have index on TEXT field, can you elobrate on reason why varchar is better for quick index lookup for exactness?

    • @AsliEngineering
      @AsliEngineering  10 месяцев назад

      that will be in my next couple of videos. some really interesting decisions taken by postgreSQL here.

  • @gecarter53
    @gecarter53 10 месяцев назад

    Good comparison of the 3 data types. What about NVARCHAR?

  • @DD-ds7ui
    @DD-ds7ui 9 месяцев назад

    best channel! Thank you for sharing your knowledge 🙏🏽

  • @sharadkaushik79
    @sharadkaushik79 10 месяцев назад +1

    thanks Arpit bhai

  • @drunkcse7476
    @drunkcse7476 9 месяцев назад

    Please make a video on index only scan vs index scan vs bitmap index.

  • @rohitdeshmukh197
    @rohitdeshmukh197 10 месяцев назад

    Great content, exactly what I wanted to know. Thank you

  • @whenkunda8447
    @whenkunda8447 10 месяцев назад

    @arpit, can you give a usecase for char? I find it hard to believe major dbs chose to implement it if there is no use case?

    • @whenkunda8447
      @whenkunda8447 10 месяцев назад +1

      Never-mind gen AI to the rescue 😂
      • Fixed-length fields: CHAR is useful when you need to store data that always has a fixed length, like an ISBN number or a credit card number.
      • Alignment and formatting: CHAR can help with aligning data in tables or reports, ensuring consistent spacing and formatting.
      • Compatibility: In some legacy systems or older databases, CHAR might be required for compatibility reasons.

    • @AsliEngineering
      @AsliEngineering  10 месяцев назад

      It is a legacy column. Old systems and use cases had a requirement. Now it is not much prevalent.

    • @AsliEngineering
      @AsliEngineering  10 месяцев назад

      But even these are now stored with varchar. Earlier it helped with displays without post processing

    • @whenkunda8447
      @whenkunda8447 10 месяцев назад

      Thank you very much. I appreciate the response!

  • @snehil3209
    @snehil3209 10 месяцев назад

    I'm here from X. What a content man!!! Already subscribed. I'm in 4th year
    Plz guide me how should i start system design from your playlist.

    • @AsliEngineering
      @AsliEngineering  10 месяцев назад

      Start with ruclips.net/p/PLsdq-3Z1EPT36NJXTutvKcreetuHCr9a- and then explore other videos from other playlists.
      Whenever you dont understand or come across a new term. DFS.

  • @arshghaiwat5241
    @arshghaiwat5241 10 месяцев назад

    Thanks arpit❤

  • @anandatole6529
    @anandatole6529 10 месяцев назад

    Hi Arpit do you have any advance course on MongoDB

    • @AsliEngineering
      @AsliEngineering  10 месяцев назад

      nope. I do not have a course on MongoDB.

  • @harshil1466
    @harshil1466 7 месяцев назад

    Can the promotional stuff go to the end

    • @AsliEngineering
      @AsliEngineering  7 месяцев назад

      No. Given my videos are heavy on engineering, most people don't watch till the end. I need to promote things at the beginning.

    • @harshil1466
      @harshil1466 7 месяцев назад +1

      @@AsliEngineering ahh makes sense is there any way we can get a separate paid version ? Cause this is something i always get irritated by causing me to close the video.

  • @anujverma8057
    @anujverma8057 5 месяцев назад

    Good information but it would be best if the information is in hindi .

  • @kaushikkumarbora
    @kaushikkumarbora 10 месяцев назад

    Arpit take some vitamin d

  • @VedankPande
    @VedankPande 10 месяцев назад

    I'm designing a new-ish schema right now and was contemplating between varchar and text. Immaculate timing!🫡