Skip to main content

Questions tagged [varchar]

Normally refers to a variable length string data type.

1 vote
1 answer
82 views

have a log table that stores execution logs for many different functions. Each row contains the function name, and the table has millions of rows. To improve performance and manage the data better, I ...
Arm.'s user avatar
  • 11
2 votes
1 answer
121 views

I created a table in Redshift and entered data as below. create table public.temp ( id int, name varchar(20) ); insert into public.temp (id, name) values (1, 'bob'), (2, 'bob '); And when ...
임승현Seunghyun Lim's user avatar
0 votes
1 answer
79 views

Are there any optimization benefits (storage/query speed/...) of choosing specific lengths for VARCHAR columns in PostgreSQL? Like, 2^n-1 or something similar?
xaxa's user avatar
  • 111
-1 votes
1 answer
95 views

I'm comparing the storage efficiency of VARCHAR and TEXT data types in MySQL 8, using the InnoDB storage engine and the default utf8mb4 character set with utf8mb4_general_ci collation. I want to ...
jithin giri's user avatar
0 votes
1 answer
87 views

I am new to string handling in SQL server and was wondering what makes the below code return the result it returns. Could I please have a detailed explanation? My code: Select CAST(CAST(CAST('08' as ...
varun as's user avatar
-1 votes
2 answers
804 views

"Often, you get the right outcome without doing so." Example: select CONVERT(varchar, getdate(), 112) outputs 20240417 I saw this in quite a few places on Stack Exchange until I found a ...
questionto42's user avatar
0 votes
1 answer
157 views

I have a table that I believe owes most of its size to a huge NVARCHAR(max) column. I do not know how to test where most of its size comes from. Regardless, would such a table benefit from row ...
J. Mini's user avatar
  • 1,352
0 votes
0 answers
103 views

We have a database running on AWS Aurora Mysql with version 8.0.mysql_aurora.3.04.1 as a regional database. There is a table in it with a column with varchar size 200. We want to reduce it to varchar(...
Tanmay Sule's user avatar
-1 votes
3 answers
662 views

My biggest table owes most of its size to a stupid NVARCHAR(max) column that I wager could easily be NVARCHAR(4000) or smaller. What steps can I take to become confident that this change is safe to ...
J. Mini's user avatar
  • 1,352
1 vote
1 answer
246 views

Imagine I have a column name that is n rows and the nth entry is equal to REPEAT(' ', n). For SELECT DISTINCT name FROM table I would expect to receive n rows because each name is unique by definition....
Tanner Clary's user avatar
2 votes
1 answer
211 views

I have a column defined as character varying(20). But it is accepting more than 20 characters. I've already searched but couldn't find anything about it (maybe I'm searching wrong). Has anyone ...
FranS's user avatar
  • 23
2 votes
1 answer
1k views

I'm using MySQL 8.0 (inside Azure Database for MySQL Server). I've noticed some strange behavior while querying with the "json_extract" functionality. In the example below, I am querying a ...
WannabeCoder's user avatar
2 votes
1 answer
572 views

I have a table with ~100mln rows. One of the columns is a VARCHAR(64) with utf8mb4 encoding for storing user nicknames (others are few integers). The data in that column has MAX(LENGTH()) == 42 and ...
herhor67's user avatar
2 votes
3 answers
181 views

It is clear that omitting the length from a varchar is a bad thing. Unfortunately I am now working with a code base where this has happened. Extensively. I would like to correct this. The first step ...
Michael Green's user avatar
0 votes
2 answers
383 views

There is a table that has a column defined as follows: text_id varchar(255) NOT NULL I know that using varchar is optimal for storing text because it allows for variable length columns but in this ...
Jim's user avatar
  • 123

15 30 50 per page
1
2 3 4 5
11