Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-06 Thread Roberta Jask�lski
2014/11/04 11:04 -0800, Jan Steinman I was not suggesting it for dates. The OP appeared to have a well-defined set of strings in a VARCHAR field — THAT is what I suggested ENUMs for! What is the update frequency of those VARCHARs? If you're adding them often — or if you need

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-06 Thread Zbigniew
2014-11-06 21:49 GMT+01:00, Roberta Jaskólski h...@tbbs.net: Ugh--I missed the discussion shift from the DATEs to the VARCHAR labels ... and now I wholeheartedly agree with you. As for the DATEs, I yet suspect that for performance maybe TIMESTAMP is slightly better than DATE. Well what I'm

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-04 Thread Johan De Meersman
- Original Message - From: Zbigniew zbigniew2...@gmail.com Subject: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access? What about using ENUMs? They have nearly the performance of INTEGERs, but you don't have to maintain a string mapping in your programming

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-04 Thread Jan Steinman
integrity is external to MySQL, and has to be managed. ... and maybe is useful if the set of dates is well determined... I was not suggesting it for dates. The OP appeared to have a well-defined set of strings in a VARCHAR field — THAT is what I suggested ENUMs for! There is a design cost

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-03 Thread Hal�sz S�ndor
2014/11/02 13:19 +0100, Zbigniew So you guys (Jan and hsv) suggest, that switching from DATE to more numeric data type may not be necessary, but using ENUM instead of VARCHAR can be real performance gain, right? But are you able to estimate, what boost can i notice? 5% - or 50%, or maybe even

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-02 Thread Zbigniew
may not be necessary, but using ENUM instead of VARCHAR can be real performance gain, right? But are you able to estimate, what boost can i notice? 5% - or 50%, or maybe even 500%? -- Zbig -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-11-02 Thread Jan Steinman
bit faster than TIMESTAMP. using ENUM instead of VARCHAR can be real performance gain, right? Not just in performance, but it appears to simply be The Right Thing To Do(TM) in your case. (Codd Rule #10: referential integrity.) Consider an insert into a day-of-week column (for instance

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-10-30 Thread hsv
2014/10/29 20:56 +0100, Zbigniew Now to the point: considering, that the second column shall contain about 100-200 different labels - so in average many of such labels can be repeated one million times (or even more) - will it speed-up the selection done with something like ...WHERE label='xyz'

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-10-30 Thread Jan Steinman
From: Zbigniew zbigniew2...@gmail.com Now to the point: considering, that the second column shall contain about 100-200 different labels - so in average many of such labels can be repeated one million times (or even more) What about using ENUMs? They have essentially the performance of

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-10-30 Thread Jan Steinman
From: Zbigniew zbigniew2...@gmail.com Now to the point: considering, that the second column shall contain about 100-200 different labels - so in average many of such labels can be repeated one million times (or even more) What about using ENUMs? They have nearly the performance of

Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-10-29 Thread Zbigniew
I'm going to establish a large database (ISAM) of simple structure, say the table with only 3 columns: - VARCHAR(80) - VARCHAR(40) - DATE The number of rows can be quite large, about hundred million or so. The first column, containing actual information, will contain unique values, unlike

Re: how to create unique key for long varchar?

2013-11-05 Thread Dan Nelson
In the last episode (Nov 05), Li Li said: I want to create a table with a long varchar column, maybe it's the url. according to dns spec, the url's max length is fixed. but I have to deal with url having long params such as a.html?q=fl

RE: how to create unique key for long varchar?

2013-11-05 Thread Rick James
. -Original Message- From: Dan Nelson [mailto:dnel...@allantgroup.com] Sent: Tuesday, November 05, 2013 7:56 AM To: Li Li Cc: mysql@lists.mysql.com Subject: Re: how to create unique key for long varchar? In the last episode (Nov 05), Li Li said: I want to create a table with a long

Re: how to create unique key for long varchar?

2013-11-05 Thread Li Li
: In the last episode (Nov 05), Li Li said: I want to create a table with a long varchar column, maybe it's the url. according to dns spec, the url's max length is fixed. but I have to deal with url having long params such as a.html?q=fl=

Re: how to create unique key for long varchar?

2013-11-05 Thread Michael Dykman
: In the last episode (Nov 05), Li Li said: I want to create a table with a long varchar column, maybe it's the url. according to dns spec, the url's max length is fixed. but I have to deal with url having long params such as a.html?q=fl

Re: how to create unique key for long varchar?

2013-11-05 Thread Li Li
is that if I define md5 as unique key and there exists 2 different urls with the same md5. I can't insert the second url anymore On Tue, Nov 5, 2013 at 11:55 PM, Dan Nelson dnel...@allantgroup.com wrote: In the last episode (Nov 05), Li Li said: I want to create a table with a long varchar column

how to create unique key for long varchar?

2013-11-04 Thread Li Li
hi all I want to create a table with a long varchar column, maybe it's the url. according to dns spec, the url's max length is fixed. but I have to deal with url having long params such as a.html?q=fl= I want the url is unique

Re: Still struggling witn like 'CTV%' over varchar.... I simple cannot understand..

2012-11-28 Thread Johan De Meersman
- Original Message - From: Andrés Tello mr.crip...@gmail.com showed the usage of the index, then, some time later, it show, for the same query, the usage of no index... Look at the rows field. It's obvious that this table is live and rather on the active side; and the data has

Still struggling witn like 'CTV%' over varchar.... I simple cannot understand..

2012-11-27 Thread Andrés Tello
mysql explain select * from cuenta where rutaCuenta like 'CTV%'; ++-++---+---++-+--++-+ | id | select_type | table | type | possible_keys | key| key_len | ref | rows | Extra |

Re: Partitioning on a Substring of Varchar Column in Mysql

2012-09-22 Thread Adarsh Sharma
primary key on ( `id` varchar(255) NOT NULL, ) column. I cannot alter the schema. So if i need to partition on created column then i need to put primary key as ( id,created_time ) that is not accepted because this causes duplicate records of id under different created times. i.e i ask in my first

Partitioning on a Substring of Varchar Column in Mysql

2012-09-21 Thread Adarsh Sharma
-keys.html . Is it possible i can create partitioning on a substring of varchar(255) ( id ) column. Below are the some contents of my id column :- 0038000-120614070130414-sudoie-sudoi-C@86 | | 0038000-120614070130414-sudoie-sudoi-C@87 | | 0038000-120614070130414-sudoie-sudoi-C@88 | | 0038000

Re: Partitioning on a Substring of Varchar Column in Mysql

2012-09-21 Thread Adarsh Sharma
partitioning function as it is clearly mentioned in http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-partitioning-keys-unique-keys.html . Is it possible i can create partitioning on a substring of varchar(255) ( id ) column. Below are the some contents of my id column

RE: Partitioning on a Substring of Varchar Column in Mysql

2012-09-21 Thread Rick James
that there will be any benefit. See tips in http://mysql.rjweb.org/doc.php/ricksrots -Original Message- From: Adarsh Sharma [mailto:eddy.ada...@gmail.com] Sent: Friday, September 21, 2012 5:09 AM To: mysql@lists.mysql.com Subject: Re: Partitioning on a Substring of Varchar Column

RE: efficient use of varchar?

2011-04-07 Thread Jerry Schwartz
-Original Message- From: petya [mailto:pe...@petya.org.hu] Sent: Wednesday, April 06, 2011 3:55 PM To: John G. Heim Cc: mysql@lists.mysql.com Subject: Re: efficient use of varchar? Hi, There is difference between varchar(63) and varchar(38). Instead of selecting MAX(LENGTH()) you can do

RE: efficient use of varchar?

2011-04-07 Thread Jerry Schwartz
use of varchar? -Original Message- From: petya [mailto:pe...@petya.org.hu] Sent: Wednesday, April 06, 2011 3:55 PM To: John G. Heim Cc: mysql@lists.mysql.com Subject: Re: efficient use of varchar? Hi, There is difference between varchar(63) and varchar(38). Instead of selecting MAX

efficient use of varchar?

2011-04-06 Thread John G. Heim
Does it make any difference if I allocate a particular number of bytes for a varchar? I mean, just as an example, maybe its more efficient to use a power of 2 as the field length. Or maybe power of 2 minus 1. I'm guessing not and that anything less than 255 is the same. I'm converting some

Re: efficient use of varchar?

2011-04-06 Thread petya
Hi, There is difference between varchar(63) and varchar(38). Instead of selecting MAX(LENGTH()) you can do PROCEDURE ANALYZE() on the table, which will tell you about the optimal record type for the data you currently have in the table. When you are using inreasonably large varchar columns

Re: storage difference in VARCHAR(size)?

2009-11-11 Thread Martijn Tonies
10, 2009 at 6:37 PM, Waynn Lue waynn...@gmail.com wrote: Hey all, I was building a table for storing email addresses today and ran into an issue that I couldn't find an answer for using Google. If I declare the column as a VARCHAR (this is an InnoDB table), does it matter what size I declare

Re: storage difference in VARCHAR(size)?

2009-11-11 Thread Johan De Meersman
couldn't find an answer for using Google. If I declare the column as a VARCHAR (this is an InnoDB table), does it matter what size I declare it as if it's between 1 and 255? I know there's an extra byte of storage once it goes above 255 because of the length, but is there a storage difference

Re: storage difference in VARCHAR(size)?

2009-11-11 Thread Waynn Lue
the column as a VARCHAR (this is an InnoDB table), does it matter what size I declare it as if it's between 1 and 255? I know there's an extra byte of storage once it goes above 255 because of the length, but is there a storage difference between VARCHAR(100) and VARCHAR(255)? Obviously

Re: storage difference in VARCHAR(size)?

2009-11-11 Thread Martijn Tonies
Your mail suggests that you *are* seeing a difference, though. What are you seeing? What I was saying, is that VARCHAR takes up space l (= length) of the data plus 1 or 2 bytes to store the length, while CHAR takes up the full space of the -defined- column size. This is rather wasteful when

Re: storage difference in VARCHAR(size)?

2009-11-11 Thread Johan De Meersman
, is that VARCHAR takes up space l (= length) of the data plus 1 or 2 bytes to store the length, while CHAR takes up the full space of the -defined- column size. This is rather wasteful when storing CHAR data that doesn't take up the full available space (as this is padded with spaces up

storage difference in VARCHAR(size)?

2009-11-10 Thread Waynn Lue
Hey all, I was building a table for storing email addresses today and ran into an issue that I couldn't find an answer for using Google. If I declare the column as a VARCHAR (this is an InnoDB table), does it matter what size I declare it as if it's between 1 and 255? I know there's an extra

Re: storage difference in VARCHAR(size)?

2009-11-10 Thread Michael Dykman
email addresses today and ran into an issue that I couldn't find an answer for using Google.  If I declare the column as a VARCHAR (this is an InnoDB table), does it matter what size I declare it as if it's between 1 and 255?  I know there's an extra byte of storage once it goes above 255

Re: Lost my defaults on varchar columns?

2008-04-06 Thread Baron Schwartz
Hi, On Fri, Apr 4, 2008 at 1:46 PM, Ed W [EMAIL PROTECTED] wrote: It appears that since updating from mysql 5.0.44 to 5.0.54 I have also lost my DEFAULT option on all my varchar columns. For colums which are also NOT NULL this is causing a bunch of problems in my existing app (trying

Lost my defaults on varchar columns?

2008-04-04 Thread Ed W
It appears that since updating from mysql 5.0.44 to 5.0.54 I have also lost my DEFAULT option on all my varchar columns. For colums which are also NOT NULL this is causing a bunch of problems in my existing app (trying to insert NULLS) Anyone can explain what happened and why this has

RE: Did NOT condition on VARCHAR change with 5.0.45?

2008-01-23 Thread Jerry Schwartz
-Original Message- From: Mont McAdam [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 22, 2008 7:18 PM To: mysql@lists.mysql.com Subject: Re: Did NOT condition on VARCHAR change with 5.0.45? `method` is the name of the column in the table. In my opinion it should return every

Re: Did NOT condition on VARCHAR change with 5.0.45?

2008-01-23 Thread Perrin Harkins
On Jan 22, 2008 7:18 PM, Mont McAdam [EMAIL PROTECTED] wrote: In my opinion it should return every record from the table where `method` is equal to NULL, ZERO or EMPTY STRING, as this table doesn't allow null, and the field type is varchar, this would be EMPTY STRING's only. Although

Re: Did NOT condition on VARCHAR change with 5.0.45?

2008-01-22 Thread Mont McAdam
`method` is the name of the column in the table. In my opinion it should return every record from the table where `method` is equal to NULL, ZERO or EMPTY STRING, as this table doesn't allow null, and the field type is varchar, this would be EMPTY STRING's only. This has always worked

Re: Did NOT condition on VARCHAR change with 5.0.45?

2008-01-15 Thread Martijn Tonies
Hi, I am having a problem with MySQL 5.0.45 returning what I consider to be unexpected results. Basically I am attempting the following query, and ALL records are being returned. SELECT * FROM `jos_products_orders` WHERE NOT `method` For the uninformed, what should this do according to you?

Re: Did NOT condition on VARCHAR change with 5.0.45?

2008-01-15 Thread Moon's Father
What is method mean in your sql statement? On Jan 15, 2008 5:33 PM, Martijn Tonies [EMAIL PROTECTED] wrote: Hi, I am having a problem with MySQL 5.0.45 returning what I consider to be unexpected results. Basically I am attempting the following query, and ALL records are being returned.

Did NOT condition on VARCHAR change with 5.0.45?

2008-01-14 Thread Mont McAdam
, `ordered` datetime NOT NULL, `paid` int(11) NOT NULL default '0', `released_by` int(11) NOT NULL, `paid_at` datetime NOT NULL, `method` varchar(10) NOT NULL, `order` text NOT NULL, `amount` float NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=215

Re: Extract String only from varchar Field?

2007-07-27 Thread Joerg Bruehe
. If you are post processing the data on the front end, it may be quicker and certainly easier to do it there. Agree - see below. On Jul 26, 2007, at 7:40 AM, Lars Schwarz wrote: hi all, is there any shorthand to extract the string part of a varchar field only? like when having german street

Re: Extract String only from varchar Field?

2007-07-27 Thread Lars Schwarz
. If you are post processing the data on the front end, it may be quicker and certainly easier to do it there. Agree - see below. On Jul 26, 2007, at 7:40 AM, Lars Schwarz wrote: hi all, is there any shorthand to extract the string part of a varchar field

Re: Extract String only from varchar Field?

2007-07-26 Thread Baron Schwartz
Hi Lars, Lars Schwarz wrote: hi all, is there any shorthand to extract the string part of a varchar field only? like when having german street addresses (e.g. foostreet 23) in a varchar field and i want to select the non-numeric part of it (foostreet) only? I can't think of a way to do

Extract String only from varchar Field?

2007-07-26 Thread Lars Schwarz
hi all, is there any shorthand to extract the string part of a varchar field only? like when having german street addresses (e.g. foostreet 23) in a varchar field and i want to select the non-numeric part of it (foostreet) only? thanks, best: lars

Re: Extract String only from varchar Field?

2007-07-26 Thread Brent Baisley
end, it may be quicker and certainly easier to do it there. On Jul 26, 2007, at 7:40 AM, Lars Schwarz wrote: hi all, is there any shorthand to extract the string part of a varchar field only? like when having german street addresses (e.g. foostreet 23) in a varchar field and i want

Extract String only from varchar Field?

2007-07-24 Thread Lars Schwarz
hi all, i'm looking for a function to extract the string part of a varchar field only. like when you stored an street address in one field like foobar street 23 and i want everything except the numeric value of it. is it possible without a regexp? if not, anyone has a regexp for that purpose

Extract String only from varchar Field?

2007-07-24 Thread Lars Schwarz
hi all, i'm looking for a function to extract the string part of a varchar field only. like when you stored an street address in one field like foobar street 23 and i want everything except the numeric value of it. is it possible without a regexp? if not, anyone has a regexp for that purpose

How to Query by First Part of a VARCHAR?

2007-07-04 Thread David T. Ashley
If I have a table with rows like this, all varchar: DOG_LUCY DOG_CHARLIE DOG_LASSIE DOG_XRAY CAT_MR_BIGGLESWORTH CAT_SCRATCHER CAT_WHISTLER what is the form of a query that will return the rows where the first part of the string matches? For example, what if I'd like to return the rows

Re: How to Query by First Part of a VARCHAR?

2007-07-04 Thread gary
SELECT column FROM table WHERE column LIKE CAT\_%; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: How to Query by First Part of a VARCHAR?

2007-07-04 Thread David T. Ashley
On 7/4/07, gary [EMAIL PROTECTED] wrote: SELECT column FROM table WHERE column LIKE CAT\_%; Would it be reasonable to assume that if column is indexed, the query would execute quickly, i.e. I would assume that the indexing would facilitate this kind of query?

Re: How to Query by First Part of a VARCHAR?

2007-07-04 Thread Dan Nelson
In the last episode (Jul 04), David T. Ashley said: On 7/4/07, gary [EMAIL PROTECTED] wrote: SELECT column FROM table WHERE column LIKE CAT\_%; Would it be reasonable to assume that if column is indexed, the query would execute quickly, i.e. I would assume that the indexing would

Re: How to Query by First Part of a VARCHAR?

2007-07-04 Thread David T. Ashley
randomly with a string of 6 digits but setting each varchar within a row the same, and executing queries. s3 is indexed (below). LIKE CAT% was obscenely fast on an indexed column. LIKE %CAT% was obscenely slow. Thanks for the help. - mysql explain stest

Re: How to Query by First Part of a VARCHAR?

2007-07-04 Thread gary
the thing to remember is that if you only want strings that start with CAT you'd never want to query with %CAT% because this could match DOG_CATHY. % is a wildcard that matches any number of characters including none. if you want to match a single character you use _ if you actually need to

How to parition a table with a VARCHAR Primary Key?

2007-06-07 Thread Eric B.
Hi, I'm struggling with getting my tables partitioned. All the tables I want to partition have a single primary key id which is a varchar. They also have a created datetime field to let me know when each record was added to the db. Ex: CREATE TABLE `document` ( `document_id` varchar(50

Re: Is an index on varchar column efficient?

2007-04-17 Thread murthy gandikota
mos [EMAIL PROTECTED] wrote: At 06:23 PM 4/15/2007, you wrote: Hi, I have a table with 2 million records but without an index or a primary key. The column upon which I want to create an index is a varchar. Will it give me any advantage when I have to do a select on the column? BTW, here

Re: Is an index on varchar column efficient?

2007-04-17 Thread murthy gandikota
Baron Schwartz [EMAIL PROTECTED] wrote: murthy gandikota wrote: Hi, I have a table with 2 million records but without an index or a primary key. The column upon which I want to create an index is a varchar. Will it give me any advantage when I have to do a select on the column? BTW

Is an index on varchar column efficient?

2007-04-15 Thread murthy gandikota
Hi, I have a table with 2 million records but without an index or a primary key. The column upon which I want to create an index is a varchar. Will it give me any advantage when I have to do a select on the column? BTW, here is the scenario: create table `test` (`phonenumber

Re: Is an index on varchar column efficient?

2007-04-15 Thread Baron Schwartz
murthy gandikota wrote: Hi, I have a table with 2 million records but without an index or a primary key. The column upon which I want to create an index is a varchar. Will it give me any advantage when I have to do a select on the column? BTW, here is the scenario: create table

Re: Is an index on varchar column efficient?

2007-04-15 Thread mos
At 06:23 PM 4/15/2007, you wrote: Hi, I have a table with 2 million records but without an index or a primary key. The column upon which I want to create an index is a varchar. Will it give me any advantage when I have to do a select on the column? BTW, here is the scenario: create

Problems with migration from 4.0.24 to 5.0.32 with unique varchar

2007-03-06 Thread Markus Fischer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I'm having trouble with the following: In the MySQL 4 database I had the following values in an unique varchar and there was no problem: Gross Groß (the latter has the german sharp s character) Now whenever I import this into the MySQL5

char vs. varchar

2007-02-28 Thread Alexander Lind
Hi all Which of these two tables wiil yield the best performance in a table with about 6 million entries (for rapid selects on either field): table_using_char field1 char(50), field2 char(50), filed 3 char(50), separate unique indexes on all 3 fields table_using_varchar field1 varchar(50

Varchar limit warning

2007-01-05 Thread Olaf Stein
Hi all If I insert a value to great for a field (e.g. '123456' into a varchar(5) field), mysql runs the insert without warning or error and cuts of what doesn't fit. How can I tell it to launch an error and abort the insert? Thanks Olaf -- MySQL General Mailing List For list archives: http

Re: Varchar limit warning

2007-01-05 Thread ddevaudreuil
Varchar limit warning Hi all If I insert a value to great for a field (e.g. '123456' into a varchar(5) field), mysql runs the insert without warning or error and cuts of what doesn't fit. How can I tell it to launch an error and abort the insert? Thanks Olaf -- MySQL General Mailing List

Re: Varchar limit warning - similar question

2007-01-05 Thread Olaf Stein
:37 PM To MySql mysql@lists.mysql.com cc Subject Varchar limit warning Hi all If I insert a value to great for a field (e.g. '123456' into a varchar(5) field), mysql runs the insert without warning or error and cuts of what doesn't fit. How can I tell it to launch an error

Re: Varchar limit warning - similar question

2007-01-05 Thread Olaf Stein
='STRICT_TRANS_TABLES'; select @@session.sql_mode; You can read about sql_mode here. http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html Donna Olaf Stein [EMAIL PROTECTED] 01/05/2007 12:37 PM To MySql mysql@lists.mysql.com cc Subject Varchar limit warning Hi all

RE: Varchar limit warning - similar question

2007-01-05 Thread Jerry Schwartz
860.674.8796 / FAX: 860.674.8341 -Original Message- From: Olaf Stein [mailto:[EMAIL PROTECTED] Sent: Friday, January 05, 2007 1:52 PM To: [EMAIL PROTECTED] Cc: MySql Subject: Re: Varchar limit warning - similar question Thanks That works nicely. Why does that not have any effect

RE: Varchar limit warning - similar question

2007-01-05 Thread Jerry Schwartz
Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 -Original Message- From: Olaf Stein [mailto:[EMAIL PROTECTED] Sent: Friday, January 05, 2007 2:26 PM To: Jerry Schwartz Subject: Re: Varchar limit warning - similar question So what effect does e.g. int(3) have

Re: Varchar limit warning

2007-01-05 Thread Gabriel PREDA
, Olaf Stein [EMAIL PROTECTED] wrote: Hi all If I insert a value to great for a field (e.g. '123456' into a varchar(5) field), mysql runs the insert without warning or error and cuts of what doesn't fit. How can I tell it to launch an error and abort the insert? Thanks Olaf -- MySQL General

FW: varchar vs char - update statement

2006-10-30 Thread Julien Chavanton
I have a database with several tables that can have up to 100 000 rows there is ~100 updates every seconds and ~100 select query on the same table using locks. The update is always on the same field a varchar(15), I believe it will be recommended to change it to char(15) to improve performance

varchar vs char - update statement

2006-10-26 Thread Julien Chavanton
I have a database with several tables that can have up to 100 000 rows there is ~100 updates every seconds and ~100 select query on the same table with locks. The update is always on the same field a varchar(15), I believe it will be recommended to change it to char(15) to improve performance

Re: Sorting numerically within a varchar

2006-10-05 Thread mark addison
Mike At 02:42 PM 10/3/2006, you wrote: If I have the following strings in a varchar column: Piano Sonata 1 - Brendel Piano Sonata 10 - Brendel Piano Sonata 11 - Brendel Piano Sonata 12 - Brendel Piano Sonata 13 - Brendel Piano Sonata 14 - Brendel Piano Sonata 15 - Brendel Piano Sonata

Sorting numerically within a varchar

2006-10-03 Thread James Eaton
If I have the following strings in a varchar column: Piano Sonata 1 - Brendel Piano Sonata 10 - Brendel Piano Sonata 11 - Brendel Piano Sonata 12 - Brendel Piano Sonata 13 - Brendel Piano Sonata 14 - Brendel Piano Sonata 15 - Brendel Piano Sonata 16 - Brendel Piano Sonata 17 - Brendel Piano

Re: Sorting numerically within a varchar

2006-10-03 Thread Dan Buettner
FROM test ORDER BY nr; HTH, Dan On 10/3/06, James Eaton [EMAIL PROTECTED] wrote: If I have the following strings in a varchar column: Piano Sonata 1 - Brendel Piano Sonata 10 - Brendel Piano Sonata 11 - Brendel Piano Sonata 12 - Brendel Piano Sonata 13 - Brendel Piano Sonata 14 - Brendel Piano

Re: Sorting numerically within a varchar

2006-10-03 Thread mos
) -- Extracts the last word Mike At 02:42 PM 10/3/2006, you wrote: If I have the following strings in a varchar column: Piano Sonata 1 - Brendel Piano Sonata 10 - Brendel Piano Sonata 11 - Brendel Piano Sonata 12 - Brendel Piano Sonata 13 - Brendel Piano Sonata 14 - Brendel Piano Sonata 15

making varchar field to act like numeric field

2006-09-28 Thread steve
I am looking for any suggestions to this problem. I have a table with a varchar field. This field can hold textual or numeric data, but it is stored in a varchar field so the database sees it all as text. I need to be able to search and sort this field as if it were numeric. For example, here

RE: making varchar field to act like numeric field

2006-09-28 Thread Rajesh Mehrotra
Hi Steve, Try select * from table where field1=4% and field1=7% instead. Sincerely, Raj Mehrotra [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 27, 2006 11:24 PM To: mysql@lists.mysql.com Subject: making varchar field

Re: making varchar field to act like numeric field

2006-09-28 Thread Douglas Sims
sec) Douglas Sims [EMAIL PROTECTED] On Sep 27, 2006, at 10:24 PM, [EMAIL PROTECTED] wrote: I am looking for any suggestions to this problem. I have a table with a varchar field. This field can hold textual or numeric data, but it is stored in a varchar field so the database sees it all

RE: making varchar field to act like numeric field

2006-09-28 Thread Rajesh Mehrotra
@lists.mysql.com Subject: RE: making varchar field to act like numeric field Hi Steve, Try select * from table where field1=4% and field1=7% instead. Sincerely, Raj Mehrotra [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 27

Re: making varchar field to act like numeric field

2006-09-28 Thread Chris W
Rajesh Mehrotra wrote: Hi Steve, Correction: Use: select * from table where field1 like '4%' or like '5%' or like '6%' or field1 like '7%'; This would not have the desired result as it would return things like 500 or 50 or 5,000,000 etc. You must use the cast as another reply

Re: making varchar field to act like numeric field

2006-09-28 Thread Steve Musumeche
) | +---+ | 0.00 | +---+ 1 row in set, 1 warning (0.00 sec) Douglas Sims [EMAIL PROTECTED] On Sep 27, 2006, at 10:24 PM, [EMAIL PROTECTED] wrote: I am looking for any suggestions to this problem. I have a table with a varchar field. This field can

Re: making varchar field to act like numeric field

2006-09-28 Thread Dan Nelson
In the last episode (Sep 28), Steve Musumeche said: I think this method will work, however, when trying these queries, I get a SQL syntax error. mysql select cast('34' AS decimal); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL

Re: making varchar field to act like numeric field

2006-09-28 Thread Steve Musumeche
Dan, Thank you, that works! FYI, you can treat the field like a number, including sorting, numeric functions, etc. For example, select * from table order by (text_field+0.0) Steve Musumeche CIO, Internet Retail Connection [EMAIL PROTECTED] Dan Nelson wrote: In the last episode (Sep

Varchar mystery

2006-09-11 Thread Jerry Schwartz
I'm using MySQL Linux version 4.1.21 standard. I have a table with fields of a variety of types, including varchar(255) and text (which might matter). When I do SELECT MAX(LENGTH(x)) FROM tx; where x is a varchar(255), I get back 266 as the result of the query! This isn't listed as one

Re: Varchar mystery

2006-09-11 Thread Paul DuBois
Jerry Schwartz wrote: I'm using MySQL Linux version 4.1.21 standard. I have a table with fields of a variety of types, including varchar(255) and text (which might matter). When I do SELECT MAX(LENGTH(x)) FROM tx; where x is a varchar(255), I get back 266 as the result of the query

Re: Varchar mystery

2006-09-11 Thread Martijn Tonies
I'm using MySQL Linux version 4.1.21 standard. I have a table with fields of a variety of types, including varchar(255) and text (which might matter). When I do SELECT MAX(LENGTH(x)) FROM tx; where x is a varchar(255), I get back 266 as the result of the query! This isn't listed as one

RE: Varchar mystery

2006-09-11 Thread Jerry Schwartz
: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Monday, September 11, 2006 2:09 PM To: Jerry Schwartz Cc: mysql@lists.mysql.com Subject: Re: Varchar mystery Jerry Schwartz wrote: I'm using MySQL Linux version 4.1.21 standard. I have a table with fields of a variety of types, including varchar(255

Re: Query needed to convert varchar to int ....sorry previous posting was incomplete

2006-08-20 Thread Chris
--- -- -- --- -- --- --- idint(11) (NULL) NO PRI (NULL) auto_increment select,insert,update,references indicatorName varchar(255) utf8_general_ci YES (NULL) select,insert,update,references periodName

Query to convert a varchar into int

2006-08-19 Thread VenuGopal Papasani
--- -- -- --- -- --- --- idint(11) (NULL) NO PRI (NULL) auto_increment select,insert,update,references indicatorName varchar(255) utf8_general_ci YES (NULL) select,insert,update,references periodNamevarchar(255) utf8_general_ci

Query needed to convert varchar to int ....sorry previous posting was incomplete

2006-08-19 Thread VenuGopal Papasani
--- -- -- --- -- --- --- idint(11) (NULL) NO PRI (NULL) auto_increment select,insert,update,references indicatorName varchar(255) utf8_general_ci YES (NULL) select,insert,update,references periodNamevarchar(255) utf8_general_ci

Re: varchar(5) and select question

2006-07-04 Thread Pooly
Hi, 2006/6/29, Joerg Bruehe [EMAIL PROTECTED]: Hi Pooly, all, Pooly wrote: Hi, I stumbled on one issue yesterday which took me some time to figure out. the table is : create table tt ( PCname varchar(5) not null default ''); insert into tt values ('Centaure'); So, by mistake I

varchar(5) and select question

2006-06-29 Thread Pooly
Hi, I stumbled on one issue yesterday which took me some time to figure out. the table is : create table tt ( PCname varchar(5) not null default ''); insert into tt values ('Centaure'); So, by mistake I inserted names which were too long for the field, but then I tried to do queries

Re: varchar(5) and select question

2006-06-29 Thread Chris White
On Thursday 29 June 2006 08:18 am, Pooly wrote: Hi, I stumbled on one issue yesterday which took me some time to figure out. the table is : create table tt ( PCname varchar(5) not null default ''); insert into tt values ('Centaure'); (5) indicates a display width. So, by mistake I

Re: varchar(5) and select question

2006-06-29 Thread Joerg Bruehe
Hi Pooly, all, Pooly wrote: Hi, I stumbled on one issue yesterday which took me some time to figure out. the table is : create table tt ( PCname varchar(5) not null default ''); insert into tt values ('Centaure'); So, by mistake I inserted names which were too long for the field, but then I

TINYTEXT != VARCHAR(255) ? (Advanced Data Generator related)

2006-06-27 Thread Denis Gerasimov
(by Upscene Productions) and tried to fill my database with some test data. However I was not able to set the option named Fill with to Preset for TINYTEXT fields while it is allowed for VARCHAR fields. This means that that tool makes some difference between these two types, but why? AFAIK some

Re: TINYTEXT != VARCHAR(255) ? (Advanced Data Generator related)

2006-06-27 Thread Martijn Tonies
(by Upscene Productions) and tried to fill my database with some test data. However I was not able to set the option named Fill with to Preset for TINYTEXT fields while it is allowed for VARCHAR fields. This means that that tool makes some difference between these two types, but why? TinyText

Converting varchar field into primary key

2006-05-16 Thread Kim Kohen
Hello, I'm creating a new MySQL database from an existing Filemaker db. My problem is that some of the existing 'numbers' in one column (it was a text field in FMP) have leading zeros. eg: 003, 0007, 012, 001234. I need to maintain these numbers 'as is' - complete with zeros. I've tried

Re: Converting varchar field into primary key

2006-05-16 Thread Martijn Tonies
as leading zeros. Why not make the VARCHAR the PK and keep the datatype? Martijn Tonies Database Workbench - development tool for MySQL, and more! Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http

Re: Converting varchar field into primary key

2006-05-16 Thread Jonathan Mangin
something as leading zeros. Why not make the VARCHAR the PK and keep the datatype? Martijn Tonies Database Workbench - development tool for MySQL, and more! The manual states (among other things) declaring a column: int(6) zerofill will left pad the column with zeros. 003 will become 03

  1   2   3   4   5   >