Re: PK or simple key?

2005-11-11 Thread Jigal van Hemert
Eamon Daly wrote: I don't know why I have so much trouble visualizing indexes, but such is life. Imagine a simple table with only two columns: user_id and foo_id. I will only ever be looking up records in this table by user_id, but I will always retrieve both fields. Figure a million rows and

Re: PK or simple key?

2005-11-11 Thread Martijn Tonies
I addition to Glebs answer... I don't know why I have so much trouble visualizing indexes, but such is life. Imagine a simple table with only two columns: user_id and foo_id. I will only ever be looking up records in this table by user_id, but I will always retrieve both fields. Figure a

Re: Does MySQL Support '=' Sign?

2005-11-11 Thread Martijn Tonies
Does MySQL support: SELECT ID_TAG= ID FROM TABLE rather than select ID TAG_ID from Table. I need this for MS SQL Compabilty. Within the SELECT statement you must use := If you were in a SET statement, you could use = or :=

Re: Sum entire group listing

2005-11-11 Thread Jigal van Hemert
Noel Stratton wrote: more thing that I can not figure out. I would like to sum all calculations created out of the Total Amount Owed field that was created. Noel, Take a look at the WITH ROLLUP modifier of GROUP BY [1]. This is available since version 4.1.1. Regards, Jigal. [1]

LIKE problem?

2005-11-11 Thread delta
Recently I ran into a problem with 'LIKE' in mysql on Debian Sarge: mysql select VERSION(); +---+ | VERSION() | +---+ | 4.1.11-Debian_4sarge2-log | +---+ 1 row in set (0.00 sec) with the following table:

Re: Best field type for exact matches on alphanumeric fields.

2005-11-11 Thread pekka
We were storing relational data all in one field in XML. We now have a need to search through that data and we're now doing fulltext searches. And as you can imagine, this is getting painfully slow. Indeed NDB does not support fulltext search. So if TEXT fieldtypes are stored in a

Re: chronological auto_increment problem

2005-11-11 Thread Jigal van Hemert
InterNetX - Andreas Prasch wrote: Hi, I have a master and a slave mysql server. On the master I write binlogs needed for replication. From time to time I have chronological auto_increment problems, here's a short explanation. - the table structure : | Field | Type| Null | Key | Default |

Re: Foreign characters in the shell

2005-11-11 Thread Götz M. Ritter
Hello Gleb, thanks very much for the hints! I will read them and then give a feedback to the list. Have a nice day,Götz -- -- ! Diese E-Mail hat 0 Anhänge -ABSENDER- name Goetz M. Ritter country Germany e-mail [EMAIL PROTECTED]

Re: Does MySQL Support '=' Sign?

2005-11-11 Thread Pooly
2005/11/11, The Nice Spider [EMAIL PROTECTED]: Does MySQL support: SELECT ID_TAG= ID FROM TABLE rather than select ID TAG_ID from Table. I need this for MS SQL Compabilty. Did you try the AS keyword ? Select ID As ID_TAG from TABLE -- Pooly Webzine Rock : http://www.w-fenec.org/ -- MySQL

Scripting Issues

2005-11-11 Thread Luke
Hey all, I've got a question for you. What would be the best way to set up a set of srcipts to create\Update the databse when my app is installed? The problem is that I obviously can't just drop the database cause if the database is already installed then the client would lose all his data. I

Re: Fulltext boolean search and the asterix

2005-11-11 Thread Jigal van Hemert
Paul DuBois wrote: At 10:49 +0100 11/8/05, Jigal van Hemert wrote: Lindsey wrote: but do you know how to use the * in regexp searches. err what i mean if i want to search for * and not use it as asterix? To use a literal instance of a special character in a regular expression, precede it by

Re: Does MySQL Support '=' Sign?

2005-11-11 Thread SGreen
Martijn Tonies [EMAIL PROTECTED] wrote on 11/11/2005 03:42:42 AM: Does MySQL support: SELECT ID_TAG= ID FROM TABLE rather than select ID TAG_ID from Table. I need this for MS SQL Compabilty. Within the SELECT statement you must use := If you were in a SET

Re: Scripting Issues

2005-11-11 Thread Dobromir Velev
Hi, Why don't you run the CREATE TABLE query with the IF NOT EXISTS clause then your script could look like this CREATE TABLE IF NOT EXISTS table_name ...; ALTER TABLE table_name; If the table already exists only the ALTER statement will be executed, otherwise the ALTER statement will not do

Re: PK or simple key?

2005-11-11 Thread Eamon Daly
Got it. Thanks to all who replied: speed is the primary concern here, so I'll be going with the first approach, especially since I could use the unique constraint. Eamon Daly - Original Message - From: Martijn Tonies [EMAIL

Re: Does MySQL Support '=' Sign?

2005-11-11 Thread Martijn Tonies
Did you read the link? Yes. The OP wanted to know if MySQL supported the = sign in a SELECT statement. The documentaion I referred the OP to clearly differentiates the use of = and := within SELECT statements and SET statements for MySQL. If the MySQL behavior is not what they were hoping for

RE: Sum entire group listing

2005-11-11 Thread ISC Edwin Cruz
SELECT products.product, products.price, count( log.product ) AS 'Count', ROUND(price*count(log.product), 2) AS 'Total' FROM products LEFT JOIN log ON products.product= log.product GROUP BY product Union SELECT 'Total', '', count( log.product ) AS 'Count', ROUND(price*count(log.product), 2) AS

Re: 1266 creating innodb tables

2005-11-11 Thread P. Evans
skip-innodb is commented out,thats why its not in the options I sent previously. The logs are showing something peculiar - InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes InnoDB: than specified in the .cnf file 0 268435456 bytes! ls shows : drwxr-x---

client/server differences

2005-11-11 Thread Stanton, Brian
I'm looking to use a RHEL4 server with standard RHEL4 packages to connect to a RHEL4 MySQL 5.0 server. I was curious if anyone knows of any known problems with a 4.1 client (the one provided with RHEL4) communicating to a 5.0 database? It connects fine, but wanted to be sure there were not any

Re: Can't start mysql 5.0.15

2005-11-11 Thread Greg Maruszeczka
Saffa Kemokai wrote: I am unable to start mysql after several trials and fixes. I compiled a mysql 5.0.15 source for FreeBSD 5.3. It doesn't seem to have placed the files in their proper locations. Below is what I keep getting and I don't know now how to get it working. What do I need to do

Re: 1266 creating innodb tables

2005-11-11 Thread Jasper Bryant-Greene
P. Evans wrote: skip-innodb is commented out,thats why its not in the options I sent previously. The logs are showing something peculiar - InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes InnoDB: than specified in the .cnf file 0 268435456 bytes! ls shows

Just for fun... subqueries

2005-11-11 Thread Scott Hamm
I was fooling around, learning subqueries, group by and everything unearthing my mental unknowns of SQL world. So I thought I would divide total letters of the entire bible by total numbers of books, chapters and verses. Here is what I came up with the best optimization possible to my knowledge

Re: Database IDs

2005-11-11 Thread Björn Persson
[EMAIL PROTECTED]: Robert Crowell [EMAIL PROTECTED] wrote on 11/11/2005 12:39:37 AM: If I am relying on MySQL's AUTO_INCREMENT feature for the id for a table,how can I reliably retrieve the ID of an item I just entered into the database? TFM is your friend. What you are looking for is

Best Fieldtype to store IP address...

2005-11-11 Thread Cory @ SkyVantage
I'm using MySQL-Cluster 5.0, and we're doing some research. What is everyone's opinion as to what the best fieldtype to store an IP address in? varchar(16) ? because 16 is the max chars of an ip address... char(16) ? text(16) Not quite sure how to get the best memory utilization... --

Re: Best Fieldtype to store IP address...

2005-11-11 Thread Peter M. Groen
On Friday 11 November 2005 21:33, Cory @ SkyVantage wrote: I'm using MySQL-Cluster 5.0, and we're doing some research. What is everyone's opinion as to what the best fieldtype to store an IP address in? varchar(16) ? because 16 is the max chars of an ip address... char(16) ? text(16)

Re: Best Fieldtype to store IP address...

2005-11-11 Thread Evan Borgstrom
The same way the kernel deals with them; int(10) unsigned. To convert a dotted quad string into int(10) use the following: Using 192.168.10.50: 192 + (168 * 2^8) + (10 * 2^16) + (50 * 2^24) = 839559360 This is real handy if you're doing low level socket stuff and storing

Re: Best Fieldtype to store IP address...

2005-11-11 Thread pekka
varchar(16) ? because 16 is the max chars of an ip address... char(16) ? text(16) Assuming you want it as text for easy searches, char(16). In 5.0 varchar(16) just uses unnecessary extra 4 bytes. Even in 5.1 (which has true varchar) I'd use char(16). text(16) is a blob and uses 8+256 bytes

Re: Best Fieldtype to store IP address...

2005-11-11 Thread Jasper Bryant-Greene
Peter M. Groen wrote: On Friday 11 November 2005 21:33, Cory @ SkyVantage wrote: I'm using MySQL-Cluster 5.0, and we're doing some research. What is everyone's opinion as to what the best fieldtype to store an IP address in? varchar(16) ? because 16 is the max chars of an ip address...

RE: Best Fieldtype to store IP address...

2005-11-11 Thread Logan, David (SST - Adelaide)
You could also use the built in functions INET_ATON and INET_NTOA documented at http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html These will do the work for you Regards # INET_ATON(expr) Given the dotted-quad representation of a network address as a string, returns an

Re: Best Fieldtype to store IP address...

2005-11-11 Thread Tim Schuh
Evan Borgstrom wrote: The same way the kernel deals with them; int(10) unsigned. To convert a dotted quad string into int(10) use the following: Using 192.168.10.50: 192 + (168 * 2^8) + (10 * 2^16) + (50 * 2^24) = 839559360 This is real handy if you're doing low level socket

Re: Best Fieldtype to store IP address...

2005-11-11 Thread Michael Stassen
Cory @ SkyVantage wrote: I'm using MySQL-Cluster 5.0, and we're doing some research. What is everyone's opinion as to what the best fieldtype to store an IP address in? varchar(16) ? because 16 is the max chars of an ip address... char(16) ? text(16) Not quite sure how to get the best

Re: Best Fieldtype to store IP address...

2005-11-11 Thread Evan Borgstrom
Yep, I know int(10) is just a display width... it's habit, probably a bad one. And you're right about it being backwards, I used bc and the top of my head to come up with that, I should've mentioned it in the email. -Evan Michael Stassen wrote: Cory @ SkyVantage wrote: I'm using

Re: MySQL insert performance

2005-11-11 Thread Dhiren Bhatia
Any ideas on how I can optimize this? Thanks. On 11/9/05, Dhiren Bhatia [EMAIL PROTECTED] wrote: This is on a development box, 1.5 GB RAM, 1CPU (1.6GHz) with the app server database server running on the same box. I'm using the Tomcat Database Connection Pool to get a JDBC connection and

Re: MySQL insert performance

2005-11-11 Thread Matthew Lenz
what does the JDBC code look like that your using to do the inserts? On Fri, 2005-11-11 at 13:56 -0800, Dhiren Bhatia wrote: Any ideas on how I can optimize this? Thanks. On 11/9/05, Dhiren Bhatia [EMAIL PROTECTED] wrote: This is on a development box, 1.5 GB RAM, 1CPU (1.6GHz) with the

asking opinion about hosting database and webserver on the same server

2005-11-11 Thread Bing Du
Hello all, Should MySQL and Apache be hosted on separate servers or it's ok they being on one server? We're building a compound that includes about 10 websites, all their contents are hosted in MySQL. There will be frequent database updates and the webserver will have to handle heavy traffic.

Re: asking opinion about hosting database and webserver on the same server

2005-11-11 Thread Gary Richardson
It depends on what heavy traffic is and what your machine is.. If it's an E10K, then you can probably put them both on one machine for most traffic loads :) Your database will typically perform better if you have your DB on a separate machine. Without knowing more about the code running the

Re: confirm subscribe to mysql@lists.mysql.com

2005-11-11 Thread Dylan
On Friday 11 Nov 2005 23:05, [EMAIL PROTECTED] wrote: To confirm that you would like [EMAIL PROTECTED] added to the mysql mailing list, please click on the following link: http://lists.mysql.com/s/mysql/437523a6f4bb2030/mysql=dylan.me.uk This confirmation serves two purposes. First,

Re: LIKE problem?

2005-11-11 Thread Jeremy Cole
Hi, Moreover, the sum of the results of these two queries select count(*) from user where username like 'a%'; select count(*) from user where username not like 'a%' or username is null; is not the same for all letters of the alphabet: letter like not-like sum n 2304 59317 61621 o

Unable to access mysql database with root user after upgrade?

2005-11-11 Thread Murray @ PlanetThoughtful
Hi All, I recently upgraded from MySQL 4.1.14 to 5.0.15 on my WinXP machine. For some reason my root login can't access the mysql database anymore, though I can use it to access the databases I have defined. In effect, it seems as though I have no real root (or administrator level, if that's

log-warnings

2005-11-11 Thread Marcus Bointon
At the time I reported this bug back in February: http:// bugs.mysql.com/bug.php?id=8684 I was pleased to see it apparently fixed so fast. I wasn't yet using MySQL 5, so I couldn't get the fix. I am now upgrading to 5 using mysql 5.0.15, and I find I still face much the same problem.

Re: log-warnings

2005-11-11 Thread Harrison Fisk
Hi, On Nov 11, 2005, at 10:01 PM, Marcus Bointon wrote: At the time I reported this bug back in February: http:// bugs.mysql.com/bug.php?id=8684 I was pleased to see it apparently fixed so fast. I wasn't yet using MySQL 5, so I couldn't get the fix. I am now upgrading to 5 using mysql

Re: Query producing default values

2005-11-11 Thread Jacques Brignon
Thanks to all those who provided feed back. As a result I found two ways of solving my problem, one is going along the LEFT JOIN track, and the other one is to run a script before doing the query itself whioch is doable in my environment without modifying the core software and which can then do

Updating a LONGTEXT field

2005-11-11 Thread Whil Hentzen
Hi folks, I'm converting a database to MySQL, and rewriting the code to work with MySQL from the old datastore. One of the fields in one of the tables is a longtext type that contains a history of system accesses - each time the system is touched in one form or another, a few more lines of

Re: Best Fieldtype to store IP address...

2005-11-11 Thread Rhino
- Original Message - From: Peter M. Groen [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Friday, November 11, 2005 3:37 PM Subject: Re: Best Fieldtype to store IP address... On Friday 11 November 2005 21:33, Cory @ SkyVantage wrote: I'm using MySQL-Cluster 5.0, and we're doing

Re: Updating a LONGTEXT field

2005-11-11 Thread Jasper Bryant-Greene
Whil Hentzen wrote: Hi folks, I'm converting a database to MySQL, and rewriting the code to work with MySQL from the old datastore. One of the fields in one of the tables is a longtext type that contains a history of system accesses - each time the system is touched in one form or another,

Re: Best Fieldtype to store IP address...

2005-11-11 Thread Jason Martin
On Fri, Nov 11, 2005 at 11:51:52PM -0500, Rhino wrote: Isn't there a new way to express IP addresses called IPV6(?) which has a possibility of 6 distinct parts instead of the traditional 4? I haven't seen one of these new formats myself yet but for all I know, they will become soon in the near

Re: Best Fieldtype to store IP address...

2005-11-11 Thread Jasper Bryant-Greene
Rhino wrote: Isn't there a new way to express IP addresses called IPV6(?) which has a possibility of 6 distinct parts instead of the traditional 4? I haven't seen one of these new formats myself yet but for all I know, they will become soon in the near future. Maybe you'd better choose a field