Urgent: parameter of my_hash_sort_simple

2006-09-27 Thread ViSolve DB Team
Hello, Could anyone explain me the parameter of the function my_hash_sort_simple in MySQL 5.0.20a. Which is called under strings/ctype-simple.c. Thanks, Prem

Mysql Stat - Help required

2006-09-27 Thread Ratheesh K J
Hlo, I got this Stat of MySQL. I want to know is there something to worry about, especially the number of temp tables. Key Reads/Key Read Requests = 0.007094 (Cache hit = 99.992906%) Key Writes/Key Write Requests = 0.239130 Connections/second = 8.741 (/hour = 31467.279) KB received/second =

fields separator

2006-09-27 Thread danieldinu
hi, everyone! I have a text file like this: 10:10:00 0 0 1 99 10:20:00 0 0 1 99 10:40:00 11 3 4 83 11:00:00 1 1 2 97 11:05:00 2 1 1 96 I need to load this file into a table, but I

Re: Mysql Stat - Help required

2006-09-27 Thread Chris
Ratheesh K J wrote: Hlo, I got this Stat of MySQL. I want to know is there something to worry about, especially the number of temp tables. That looks like a sign of missing indexes. Temporary tables shouldn't be created that often if your queries are indexed properly, even though they're

Re: transitioning from ms sql

2006-09-27 Thread Ow Mun Heng
On Wed, 2006-09-27 at 13:00 +0800, Wai-Sun Chia wrote: On 9/27/06, Arjun Bhandari [EMAIL PROTECTED] wrote: Hi, I have been using MS SQL for the last one year, however would not like to Huh? If you would NOT like to transition to MySQL, then why are you asking all these stuff? Stop

Re: fields separator

2006-09-27 Thread Chris
[EMAIL PROTECTED] wrote: hi, everyone! I have a text file like this: 10:10:00 0 0 1 99 10:20:00 0 0 1 99 10:40:00 11 3 4 83 11:00:00 1 1 2 97 11:05:00 2 1 1 96 I need to load this

Re: fields separators

2006-09-27 Thread danieldinu
Pe 27 Sep 2006, la 10:29, Chris [EMAIL PROTECTED] a scris: [EMAIL PROTECTED] wrote: hi, everyone! I have a text file like this: 10:10:00 0 0 1 99 10:20:00 0 0 1 99 10:40:00 11 3 4 83 11:00:00 1 1 2

Re: odd behaviour with auto_increment

2006-09-27 Thread Jorrit Kronjee
On 9/26/2006 4:02 PM, Dan Buettner wrote: Jorrit, it's a known behavior, not a bug. Recent versions of MySQL will, when given a zero (0) as a value for an auto incrementing identity column, simply fill in the next auto incrementing value ... unless you flip a switch to specifically tell it

Re: Mysql Stat - Help required

2006-09-27 Thread Ratheesh K J
I have checked the queries. They look quite ok. We have a lot lot of CREATE TEMPORARY TABLE running every second. How else can tmp tables be created? What is the exact relation between missing index and tmp tables being created. Do you mean to say in sorting? - Original Message -

Re: Mysql Stat - Help required

2006-09-27 Thread Chris
Ratheesh K J wrote: I have checked the queries. They look quite ok. We have a lot lot of CREATE TEMPORARY TABLE running every second. How else can tmp tables be created? What is the exact relation between missing index and tmp tables being created. Do you mean to say in sorting? Sorting,

Re: fields separators

2006-09-27 Thread Chris Sansom
Pe 27 Sep 2006, la 10:29, Chris [EMAIL PROTECTED] a scris: Did you try using a space (' ') as the separator? Did you get an error? And at 7:41 + 27/9/06, [EMAIL PROTECTED] wrote: Yes, I did. ... So, I need to specify somehow that the fields are delimited by any number of spaces...

key_buffer_size - need help

2006-09-27 Thread Ratheesh K J
Hlo, We have all our tables as Innodb type. As I understand the variable key_buffer_size is used only for MyISAM tables. Currently we have this var set to 256M on a 4GB RAM machine. Only the Temporary tables created using (CREATE TEMPORARY TABLE) will be of MyISAM type. And there are a lot of

design: save a decision-tree in a db

2006-09-27 Thread Jay
Hello MySQL Fans First of all, this is not about decision-trees and datamining. And it is not even MySQL-specific. I would like to use a decision-tree to save our business-rules. Rules are existing and extended frequently. Due to the complexness a hierarchical tree would fit in. (e.g. The Nested

Re: fields separators

2006-09-27 Thread danieldinu
Did you try using a space (' ') as the separator? Did you get an error? And at 7:41 + 27/9/06, [EMAIL PROTECTED] wrote: Yes, I did. ... So, I need to specify somehow that the fields are delimited by any number of spaces... One answer of course is grep. However, as far as I can determine,

Design flaw for unique key

2006-09-27 Thread Rob Desbois
My application contains a table `event` which is essentially a historical log. Currently it contains a UNIQUE KEY on three fields - the location which generated the event `location_id`, the timestamp the event was generated `timestamp`, and the type of event `type`. I have discovered that this

Count of children

2006-09-27 Thread André Hänsel
I have a table with id and parent_id. I want the count of all sub-entries for a specific entry. I found several documents about working with graphs/trees in MySQL but I could not find a solution for my problem. I can imagine two possibilities, but one is memory intensive and the other one

Re: Re: fields separators

2006-09-27 Thread Dan Buettner
Daniel, is it that the columns in the file are separated by a variable number of spaces? Or is it that the columns are fixed-width, therefore the number of spaces varies with length of data? If the file is fixed-width, the SQL below ought to work pretty well. Either way, your situation is not

RE: fields separator

2006-09-27 Thread Jerry Schwartz
I'm used to hammering all kinds of data into MySQL. Often I do it with a PHP (or Perl) script that handles this kind of thing well. However, often my data originates on a PC (don't ask), so I run it through MS Excel. Excel (and OpenOffice, I presume) has good tools for parsing text files, and can

RE: transitioning from ms sql

2006-09-27 Thread Rajesh Mehrotra
Hi Arjun, Check out the MySQL Migration Toolkit and some other tools available at http://www.mysql.com/products/tools/migration-toolkit/ and http://dev.mysql.com/downloads/gui-tools/5.0.html. Do a test migration and some testing on the migrated dataset, and you can then probably set up a plan for

Re: Count of children

2006-09-27 Thread Jo�o C�ndido de Souza Neto
You can use it: SELECT parent_id, count( * ) FROM table WHERE parent_id =1 GROUP BY parent_id It´ll works fine. André Hänsel [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] I have a table with id and parent_id. I want the count of all sub-entries for a specific entry. I found

re: Count of children

2006-09-27 Thread Rob Desbois
André, Your sentence 'I want the count of all sub-entries for a specific entry' converts straight into SQL: 'I want' SELECT the count of all entries COUNT(*) FROM myTable with a specific parent WHERE parent_id = 5 You've missed one of the major benefits of SQL - it's designed to

AW: Count of children

2006-09-27 Thread André Hänsel
Sorry, my english sentence was imprecise. :) I want the count of all sub-entries AND THEIR sub-sub-entries. Example: A / \ B C / \ D E \ F So I want to know that C has 3 sub-nodes. -Ursprüngliche Nachricht- Von: Rob Desbois [mailto:[EMAIL PROTECTED]

re: AW: Count of children

2006-09-27 Thread 'Rob Desbois'
André Sorry, my english sentence was imprecise. :) I want the count of all sub-entries AND THEIR sub-sub-entries. Example: A / \ B C / \ D E \ F So I want to know that C has 3 sub-nodes. Aha! I thought it seemed like an easy question ;-) As far as i know, the only

Re: Count of children

2006-09-27 Thread Jo�o C�ndido de Souza Neto
You must do that by a some language script, unfortunatly mysql is no recursive. André Hänsel [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] Sorry, my english sentence was imprecise. :) I want the count of all sub-entries AND THEIR sub-sub-entries. Example: A / \ B C

Re: Count of children

2006-09-27 Thread Peter Brawley
André, I want the count of all sub-entries for a specific entry. Depends on the model you are using--edge list or nested sets? PB - André Hänsel wrote: I have a table with id and parent_id. I want the count of all sub-entries for a specific entry. I found several documents about

AW: Count of children

2006-09-27 Thread André Hänsel
I will use any model that is suitable. ;) I am somewhat familiar with both tree models but I can't come up with a method to get the count of all sub- and sub-sub-nodes in either of them. -Ursprüngliche Nachricht- Von: Peter Brawley [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 27.

Re: Count of children

2006-09-27 Thread Douglas Sims
By default it doesn't, but you can change that behaviour. Quoting from this page http://dev.mysql.com/doc/refman/5.0/en/stored- procedures.html : Recursive stored procedures are disabled by default, but can be enabled on the server by setting the max_sp_recursion_depth server system

Re: AW: Count of children

2006-09-27 Thread ddevaudreuil
I've found this website to be extremely helpful: http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html Donna DeVaudreuil André Hänsel [EMAIL PROTECTED] 09/27/2006 10:55 AM To [EMAIL PROTECTED] cc mysql@lists.mysql.com Subject AW: Count of children I will use any model

Re: AW: Count of children

2006-09-27 Thread Peter Brawley
Andr With an edge list, the solution entails recursion, so you need either an sproc or application proc. With a nested sets model, the count is dead simple. If the id of the target row is N, and the left right node columns are named leftedge and rightedge, the query is SELECT COUNT(t2.id)

RE: AW: Count of children

2006-09-27 Thread Robert DiFalco
For us the querying of trees is more important than the speed of writing them. So each time we add a child or change a parent or whatever, we trigger a stored procedure that updates a paths table. Then our query for children is pretty simple: SELECT Node.* FROM Node JOIN

stored procedures and regex

2006-09-27 Thread Gregory Machin
Hi Can mysql's stored procedures do regex function -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za

Trouble compiling C on OS X

2006-09-27 Thread Tyler McMullen
First off, I apologize for the fact that I'm not more versed in the inner workings of GCC and linking libraries and etc, I'm a web developer and I'm just using C to try to cut down on some speed problems. This is my little test program: #include stdio.h #include stdlib.h #include math.h #include

Complex right left join

2006-09-27 Thread Kristian Løining
Hi. Hope this is the correct list. I'm strugling with a right and left join query: SELECT category.name AS cname, service.name AS tname, service.id AS sid FROM provider LEFT JOIN providerservice ON provider.id = providerservice.provider_id RIGHT JOIN service ON providerservice.service_id =

Inner Join on MyISAM table

2006-09-27 Thread Harini Raghavan
Hi All, I am using MyISAM storage engine for 2 of the tables in my application so as to use the full text search features. When I join any one of the MyISAM table with other INNODB table, the query is very fast. But, if I do inner join with both theMyISAM table, then the query takes 5 mins to

Low priority copy?

2006-09-27 Thread Brian Dunning
I have a very busy 14,000,000 record table. I made a new version of the table, that's more efficient, and now I just need to copy over the data. Just about anything I try swamps the machine and locks up MySQL with too many connections because it's so damn busy. Can anyone suggest the most

Re: Inner Join on MyISAM table

2006-09-27 Thread Dan Buettner
Harini, can you post the output you get from the EXPLAIN command? That is, type EXPLAIN and then the query below, and MySQL will show you an execution plan for the query that could help identify why it's taking so long. Dan On 9/27/06, Harini Raghavan [EMAIL PROTECTED] wrote: Hi All, I am

Re: Low priority copy?

2006-09-27 Thread Brent Baisley
I'm guessing what's happening is that your import is locking the table, putting everything else on hold. People keep connecting, getting put on hold until you run out of connections. It's not that you machine is so busy, it just can't do two things at once. One of the limitations of MyISAM

Re: Low priority copy?

2006-09-27 Thread Dan Buettner
Brian, I'm not sure there's a quick way to copy 14 million records, no matter how you slice it. Disabling the indexes on the destination table might help - but then you've got to devote some time to when you re-enable them. You might try this workaround, where you're copying into a duplicate of

Inserting/updating only when combo of fields is unique

2006-09-27 Thread Brian Dunning
I have a need to insert a record only when the combination of 3 fields is unique. I do this by having an index with all 3 fields, and doing an INSERT IGNORE. This works fine. Here's the element I can't figure out how to add: When there is a pre- existing record, I want to update two of its

Re: Inserting/updating only when combo of fields is unique

2006-09-27 Thread Dan Julson
Brian, Look at the ON DUPLICATE KEY UPDATE syntax within the INSERT SYNTAX of the Docs. That should give you what you want. -Dan I have a need to insert a record only when the combination of 3 fields is unique. I do this by having an index with all 3 fields, and doing an INSERT IGNORE. This

Re: Low priority copy?

2006-09-27 Thread Brian Dunning
This is the kind of thing I've been trying, but anything like this locks up the machine, all the users get errors, and I have to restart mysql. This is why I'm looking for something like a LOW PRIORITY solution, hoping that it won't try to use resources until they're available. On Sep

Re: Inserting/updating only when combo of fields is unique

2006-09-27 Thread Brian Dunning
Thanks Dan, I believe that's exactly what I was looking for. Thanks for not saying RTFM even though it clearly applies. :) On Sep 27, 2006, at 12:57 PM, Dan Julson wrote: Brian, Look at the ON DUPLICATE KEY UPDATE syntax within the INSERT SYNTAX of the Docs. That should give you what

Re: Re: Low priority copy?

2006-09-27 Thread Dan Buettner
The table switch-a-roo scheme would accomplish this - it lets you copy the data into the duplicate table, and can run as long as needed since it won't be tying up a table that your users are trying to access. Then once the move is completed, the table rename operation should complete very

[mysql]Concurrency with inserts

2006-09-27 Thread Henda Carvalho
Hello, Can somebody please tell me what is the behaviour of mysql when 2 different users are trying to make an insert to the same table. Best regards, Henda Mendes de Carvalho

[mysql]Concurrency with inserts

2006-09-27 Thread Henda Carvalho
Hello, Can somebody please tell me what is the behaviour of mysql when 2 different users are trying to make an insert to the same table. Best regards, Henda Mendes de Carvalho

Re: [mysql]Concurrency with inserts

2006-09-27 Thread Dan Nelson
In the last episode (Sep 27), Henda Carvalho said: Can somebody please tell me what is the behaviour of mysql when 2 different users are trying to make an insert to the same table. http://dev.mysql.com/doc/refman/5.0/en/table-locking.html

Red Hat slow query log

2006-09-27 Thread Brian Dunning
Before I do this, I just wanted to check with you all to see if this is the correct command: /etc/rc.d/init.d/mysqld restart --log-slow-queries If so, where exactly will I find the slow query log? Will the slow query log be turned off by default next time I restart it? -- MySQL General

[mysql]Concurrency with inserts

2006-09-27 Thread Henda Carvalho
Hi there, The links that you gave me doesn't say what is suposed to happen if 2 different users are trying to make an insert (using the insert statement) to the same table. Will the transaction abort for one of the users? Best regards, Henda On 9/27/06, Dan Nelson [EMAIL PROTECTED] wrote:

Re: [mysql]Concurrency with inserts

2006-09-27 Thread Dan Nelson
In the last episode (Sep 27), Henda Carvalho said: The links that you gave me doesn't say what is suposed to happen if 2 different users are trying to make an insert (using the insert statement) to the same table. Will the transaction abort for one of the users? No; they will both proceed.

Re: [mysql]Concurrency with inserts

2006-09-27 Thread Henda Carvalho
One more question, What kind of tables does mysql create by default? innodb or myisam? Best regards Henda On 9/27/06, Dan Nelson [EMAIL PROTECTED] wrote: In the last episode (Sep 27), Henda Carvalho said: The links that you gave me doesn't say what is suposed to happen if 2 different users

Re: Red Hat slow query log

2006-09-27 Thread Chris
Brian Dunning wrote: Before I do this, I just wanted to check with you all to see if this is the correct command: /etc/rc.d/init.d/mysqld restart --log-slow-queries If so, where exactly will I find the slow query log? Will the slow query log be turned off by default next time I restart it?

Re: Low priority copy?

2006-09-27 Thread Wagner, Chris (GEAE, CBTS)
This is a situation where u should use mysqlhotcopy. That gives u a snapshot of the current table and lets u work on it offline while the real table is available. hotcopy table A to B blank table A to allow inserts work on table B merge A into B delete A rename B to A -- Chris Wagner CBTS GE

where url = 'x' with url a TEXT field

2006-09-27 Thread Peter Van Dijck
Hi, since urls can be longer than 255 chars, I made the url field a TEXT field. The problem is, I can't make an index on it, so doing 'WHERE url='xxx'' becomes a very sloow query. Any ideas for solutions? Am I mistaken in the idea that I can't make an index on a TEXT field? Thanks! Peter --

Re: where url = 'x' with url a TEXT field

2006-09-27 Thread Douglas Sims
I think you have to specify a key length when you use an index on a text field... mysql alter table t2 add index i2(t1(3)); That would create an index (called i2) on the first 3 characters of field t1 of table t2. I think that's right? Douglas Sims [EMAIL PROTECTED] On Sep 27, 2006,

Re: where url = 'x' with url a TEXT field

2006-09-27 Thread Dan Buettner
You can create FULLTEXT indexes on text fields - but that may not be the best solution for your situation since you are querying for an exact match. In MySQL 5.0.3 and later, you can create VARCHAR columns of up to 65,535 character lengths: http://dev.mysql.com/doc/refman/5.0/en/char.html I

Re: [mysql]Concurrency with inserts

2006-09-27 Thread Dan Nelson
In the last episode (Sep 28), Henda Carvalho said: One more question, What kind of tables does mysql create by default? innodb or myisam? The default is myisam. -- Dan Nelson [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

Need to find last price and date product was sold

2006-09-27 Thread mos
This should be easy but I can't find a way of doing it in 1 step. I have a Trans table like: Product_Code: X(10) Date_Sold: Date Price_Sold: Float Now there will be 1 row for each Product_Code, Date combination. So over the past year a product_code could have over 300 rows, one row for each

Re: Need to find last price and date product was sold

2006-09-27 Thread Douglas Sims
You could do something like that by using a derived table (subselect) to pick the max date for each product sale and then joining that on the products table again to pick up the amounts. Note that you must use mysql 5.x to be able to use subselects. Also this will return multiple rows for

Mmultiple languages in the MySQL database

2006-09-27 Thread krishna
How do I store multiple languages in the MySQL database. Is there any configuration in MySql database server to support multilingual data. Normally if I use UTF-8 character encoding in database, it supports multiple languages. But it is not happening in MySql. Thanks Krish -- View this