Normally refers to a variable length string data type.
0
votes
1answer
37 views
Do certain string patterns affect query performance on a VARCHAR column?
I am a beginner on MySQL Administration and performance problems. Now this is confusing me.
I have a VARCHAR column identity, the string in it is consisted of a Class type and an id, like note:123, ...
1
vote
1answer
58 views
Varchar index - will hashing value make it faster?
I have a VARCHAR(1000) column in a table. It will contain strings that will not be guaranteed to be unique. I have a query that searches this column as part of a WHERE IN clause, the list of values in ...
0
votes
2answers
53 views
VARCHAR, InnoDB MySQL, is inline allocated space variable or fixed?
For a log table, I have a custom message column.
It will never be updated.
It will be searched with LIKE conditions.
It will be capped at 1KB.
TEXT fields are slower than VARCHAR fields for ...
1
vote
1answer
44 views
Changing TEXT to VARCHAR
In a MySQL database (InnoDB) we have a table containing roughly 60.000.000 rows. One of the columns is of type text.
Currently the longest entry has length 360 (found using SELECT MAX(LENGTH(value)) ...
5
votes
3answers
290 views
Write differences between varchar and nvarchar
Currently in our SQL Server 2012 database, we're using varchar, and we'd like to change that nvarchar. I've generated a script to do that.
My question is are there any differences in how SQL Server ...
3
votes
1answer
219 views
Possible INDEX on a VARCHAR field in MySql
I am working in a MySql database, with a table like this:
+--------------+
| table_name |
+--------------+
| myField |
+--------------+
...and I need to make a lot of queries like this (with ...
4
votes
1answer
79 views
Unexpected Unique Constraint Violation
Given the following CREATE TABLE statement:
CREATE TABLE [dbo].[Unit]
(
[id] SMALLINT NOT NULL IDENTITY(1,1),
[name] VARCHAR(100) NOT NULL,
CONSTRAINT ...
3
votes
1answer
206 views
Will one nvarchar column affect query performance?
I have one column that I recently converted to nvarchar(100) to store Asian characters. The other columns in this table, and the other tables in the same database, use varchar, int, bit and datetime. ...
6
votes
7answers
543 views
MySQL Indexing VarChar
I am trying to index my blogentries database for better performance but found an issue.
Here is the structure:
CREATE TABLE IF NOT EXISTS `blogentries` (
`id_id` int(11) NOT NULL AUTO_INCREMENT,
...
5
votes
1answer
173 views
MySQL varchar(255) limitation & Anomaly
I have defined a column in my MySQL database as :
ALTER TABLE `my_table` CHANGE `desc` `desc` VARCHAR( 255 )
CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL
However, when I enter text ...
1
vote
1answer
342 views
How to change the display of an empty string in mysql command line tool?
I'm maintaining a database with InnoDB tables.
These tables have some columns of type (from show create table):
`val0` varchar(30) default NULL,
`val1` varchar(30) default NULL,
etc...
From the ...
3
votes
2answers
2k views
Efficient way of changing VARCHAR to NVARCHAR fields in a large table in SQL Server 2008?
I am aware of when adding new fields to large tables, it is recommended to add them to the end of the fields rather than somewhere in the middle, and wondering if something like this applies when ...
2
votes
3answers
637 views
Should I add an arbitrary length limit to VARCHAR columns?
According to PostgreSQL's docs, there's no performance difference between VARCHAR, VARCHAR(n) and TEXT.
Should I add an arbitrary length limit to a name or address column?
8
votes
1answer
3k views
Varchar(Max) field cutting off data after 8000 characters SQL Server 2008
I have a field to store some data, the field is declared as varchar(Max). To my understanding this should be storing 2^31 - 1 characters but when I enter some content over 8000 chars it cuts the rest ...
4
votes
2answers
304 views
varchar performance impact
This question has been asked before ( speed impact of using varchar in MSSQL 2008 ), but the answers are not detailed enough to my satisfaction. Admitedly this is not a current issue and mainly for ...
8
votes
1answer
2k views
SQL Server 2008 Change length of varchar on live prod table
I have a MS SQL Server 2008 R2 DB server currently in use with a production app.
A new enhancement to the app now requires a varchar(100) column in a table to be increased in length.
Can the ...
2
votes
2answers
87 views
Storing NULL Values in large VARCHAR fields
I have a table that represents a "note". This note has things like a title and various other meta data. However, I'm trying to figure out the best practice for storing the contents of the note.
...
2
votes
1answer
418 views
Oracle SQL count occurances of character in VARCHAR
Is is possible to count the number of occurrences of a character in a VARCHAR in oracle? Something that would allow me to determine '11001110' has 5 ones?
3
votes
1answer
199 views
MySQL text field without quote
I've just run into something strange. The base_id is a varchar(255). When I do a SELECT without quote, it scans the whole table:
mysql> EXPLAIN SELECT sid FROM rf_fo.scald_atoms WHERE base_id = ...
6
votes
2answers
996 views
SQL Server VARCHAR Column Width
Searching around the web, I have found conflicting advice on whether there is a performance impact when specifying overly-wide VARCHAR columns, e.g. VARCHAR(255) when VARCHAR(30) will probably do.
I ...
2
votes
1answer
2k views
Rows with a variable number of columns?
I'm trying to design a database for a program that is storing and manipulating tweets off of Twitter.
I'm using code to fragment a tweet into words, usernames, and hashtags, so
I'm meeting ...
1
vote
1answer
114 views
String Pooling for MySQL
So I'm having this table that logs all errors happened in our production code. It looks like this:
id | date | type | message | file | line
...
3
votes
3answers
2k views
Does an Oracle nvarchar2 take twice as much space as varchar2?
Regarding point 4 of this question (which is in reference to MS SQL Server):
VARCHAR does not store Unicode characters.
NVARCHAR does store Unicode characters.
Today's applications should ...
4
votes
3answers
398 views
Why is Row Overflow not working on SQL Server 2005
I have a SQL Server 2005 database with a table that has around 860 columns. Aside from the ID column all other columns are varchar(N) where N is either 100 or 500. Upon inserting a new row (via an ...
11
votes
3answers
749 views
Is there any point in undersizing VARCHAR columns?
Googling around there seems to be mixed reports whether the size of a VARCHAR2 column in Oracle impacts performance or not.
I would like to give the question of VARCHAR size a little twist and hope ...
17
votes
4answers
1k views
What are the consequences of setting varchar(8000)?
Since varchar takes disk space proportional to the size of the field, is there any reason why we shouldn't always define varchar as the maximum, e.g. varchar(8000) on SQL Server?
On create table, if ...
10
votes
3answers
9k views
What is the performance impact of using CHAR vs VARCHAR on a fixed-size field?
I have an indexed column that stores an MD5 hash. Thus, the column will always store a 32-character value. For whatever reason, this was created as a varchar rather than a char. Is it worth the ...
4
votes
4answers
369 views
How much will using a varchar(15) PK affect my tables performance?
I am parsing log file lines from a legacy, proprietary application into a nice easy to query DB. The log lines have no unique integer ID. They do have a UNIX timestamp as an 8 character hex string. ...
5
votes
3answers
1k views
Which problems arise, declaring the size of all varchar parameters as max in stored proc?
Looking at this question, it seems, that other sites too have the problem of increasing column sizes in the process of time.
Increasing just the size of a column in a table is a rather simple task.
...
14
votes
5answers
3k views
Performance implications of MySQL VARCHAR sizes
Is there a performance difference in MySQL between varchar sizes? For example, varchar(25) and varchar(64000). If not, is there a reason not to declare all varchars with the max size just to ensure ...