Questions tagged [varchar]
Normally refers to a variable length string data type.
162 questions
1 vote
1 answer
82 views
partitioning by varchar column
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 ...
0 votes
1 answer
79 views
Postgresql: Any benefits of specific lengths of varchar [duplicate]
Are there any optimization benefits (storage/query speed/...) of choosing specific lengths for VARCHAR columns in PostgreSQL? Like, 2^n-1 or something similar?
0 votes
1 answer
86 views
Explanation needed for my result
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 ...
0 votes
1 answer
157 views
Will NVARCHAR(max) columns benefit from row compression?
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 ...
-1 votes
3 answers
659 views
How can a column's data type be safely reduced from NVARCHAR(max)?
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 ...
2 votes
1 answer
211 views
Column accepting more characters than defined
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 ...
2 votes
1 answer
570 views
CHAR and VARCHAR lengths for multibyte characters
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 ...
0 votes
2 answers
380 views
Varchar for columns that store numerics/ids?
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 ...