Skip to main content

Questions tagged [varchar]

Normally refers to a variable length string data type.

15 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
1k views

Is it worth using a JSON column type, even if it's only used for simple serialized strings or integers?

I have a table with an unidexed value column of VARCHAR(1024), and I've used my ORM to automatically convert it to and from JSON. The entire reason for this is I want it to be able to store any data ...
Peter's user avatar
  • 121
2 votes
1 answer
393 views

Does PostgreSQL have a variable character storage layer that optimizes storage space by automatic dedupe?

My application has a Product and a Purchased table. The Purchased table includes a full copy of the Product row at time of purchase, so that, even if a product name or description was changed, the ...
Chris Betti's user avatar
1 vote
0 answers
856 views

Would using varchar(31) be bad compared to varchar(32)?

I wonder whether using varchar(word*n) would be more efficient compared to using varchar(word*n-1). If yes, why? A 64 bit computer word equals 8.
deadwind's user avatar
1 vote
0 answers
511 views

Oracle 11.2 index on VARCHAR vs index on DATE

I have a table with 15,339,375 records and it has an index on a date field that's converted to a VARCHAR(5) and stored as "MMYDD". It has an index on the field. The records in the table are all from ...
regmar's user avatar
  • 11
0 votes
0 answers
38 views

Reduce varchar column size in a production database

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
0 votes
3 answers
153 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 ...
J. Mini's user avatar
  • 501
0 votes
1 answer
41 views

Why does Redshift ignore length when grouping by VARCHAR of only spaces?

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
0 votes
1 answer
568 views

Mysql/Mariadb - Speed up query with varchar columns already indexed but index its first 2 characters (USxxxxxxxx, CAxxxxxxxx, etc)

On my project (MariaDB 10.3), I use a table for storing data per ISIN code (a financial asset identifier). For instance, "US3696041033" for General Electric. I have 4 Millions rows in my ...
moe69230's user avatar
0 votes
1 answer
113 views

Working with varchar field in Clustered Index. (Performance Test)

I am using Microsoft SQL Server 2016. For my products table; I need to define a ClusteredIndex with 2 fields of Product Type and Product Code. ProductType(tinyint), ProductCode(varchar(32)). I know ...
omerix's user avatar
  • 91
0 votes
0 answers
237 views

Change Column size of a table

We have a mysql 5.6 cluster, 1 master 5 slaves. Requirements:- We have to modify the size of a column varchar from 20 to 35 for 2 databases. What is the best approach for doing this accross the ...
Rajan Sharma's user avatar
0 votes
2 answers
1k views

Error on updating a field with binary values

I have a problem on emoji showing on webpage after migration to new DB Server. But I have a workaround. I will get the binary values of a certain field of TABLE1 on our OLD DB Server. Then update the ...
JRA's user avatar
  • 149
0 votes
1 answer
688 views

VARCHAR automatically changes to VARBINARY

I am new to MySQL. When I declare a column as VARCHAR, why does it automatically change to VARBINARY? How should I avoid this? Database changed ...
unknown29's user avatar
0 votes
0 answers
94 views

making everything varchar on purpose, though some fields should be int

I'm writing a PHP website for some clients which parses excel, stores the value in a database and then retrieves them. Some fields are only integers, but the clients can't make up their minds, they ...
Lynob's user avatar
  • 159
0 votes
1 answer
176 views

Implicitly (or proxy) convert to Nvarchar on incoming queries from legacy or 3rd party applications

We have a 3rd party application of which we don't have the source code. This application executes queries on our database without using the "N" prefix before literal strings. It does this in inserts ...
Louis Somers's user avatar
-1 votes
1 answer
100 views

Text storage for mysql

So I want to create a command like first_name VARCHAR(30) NOT NULL, ... however I want the database to hold more characters like a text storage type. How would I set up the command for the text type?
wonderhead's user avatar