Re: SEGMENT FAULT - CORE DUMPED
Please send relevant pieces of code! Hello, I am developing a data application using wxWindows 2.2.7 on Redhat Linux 7 with MySQL at back-end. When I try to connect to MySql Database sometimes it says Segment fault (Core dumped) error. Pls help. Sudheer. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: transactions
The first that springs to mind is: pricture 2 tables. Pocket and Store. (Where pocket as in i have got money in my pocket, and store as in Let's go buy some shoes in the store!. Pocket ( money integer ) ; Store ( money integer ); Now, suppose you are supposed to TRANSFER 10 dollars from Pocket to Store. You buy some sheap shoes at some arbitrary store. SELECT money FROM Pocket... UPDATE Store... UPDATE Pocket... Do this in a transaction! If something goes wrong updating Pocket, and only the Store gets updated, you are one lucky bastard!! And we don't want that, none of us!! ;) Daniel Åkerud Paul, appreciate the feedback, but my question wasn't in reference to the actual coding and how it's used, this I understand, I was referring to when a transaction is best used, in what type of a scenario. ;) TIA - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Indexing only a prefix of the string
If I have a table: CREATE TABLE film ( title CHAR(200) NOT NULL, INDEX title_index (title(5)) ); What is the underlaying reason why it is faster to index only a prefix of the title? Is it always faster? even if i have a trillions of title 200 characters long? what should i think of when deciding of the prefixes' length? thanks! --- Daniel Åkerud [ Don't underestimate the power of stupid people in large groups]
Re: KEY and index
An index is not just putting the data in a separate file. It's about storing information in more high-tech data structures like B-trees, R-trees and hashes. MySQL only support B-Trees, which is the most commonly used. B-Trees are about storing data in a tree-like structure for very fast retrieval on slow media, like hard disks. The penalty is a bit slower insertion of data. But the results are extremely good when searching. In MySQL having a table that looks like this: idint primary key namechar(200) and making an index on name, will get you a 0.1 * original_retrieval_time when searching, but 1.5*original_insertion_time when inserting. It roughly means that (on my system that is) you should do at least one select statement for every 4000 inset statements, for the index to be profitable. So, keep in mind that an index wont allways suit you, but mostly. Daniel Åkerud. Quoting Cal Evans [EMAIL PROTECTED]: Regular keys are just indexes, not necessarily unique, not necessarily on fields that don't accept nulls. Their primary function is to speed up data retrieval. Use them sparingly as they can have a negative impact on inserting and updating records. I understand that indexes work so fast because they are usually smaller than the original table, since they contain on average just 1 column, or at least less information than the complete table. But how about a table with just 2 columns. Would an index based on the same 2 columns speed up processing, more specific, would it speed up a SELECT WHERE (the WHERE clause being related to the index algoritm) Thanks, Marco - Original Message - From: Marco Bleeker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 22, 2001 9:36 AM Subject: KEY and index Hello, I am learning MySQL and have a question. I know about the importance of the PRIMARY KEY statement, but I also see a KEY statement being used when creating a table. Is this just short for PRIMARY KEY, or what's the difference? Second question, when I have a large table, but with only 2 small cells per row (2 columns), is it useful to create a PRIMARY KEY, KEY, or INDEX for speed (there is no set relation to another table). Third question, when exactly does MySQL use indexes. Is it used when the indexed column is part of a (SELECT *) WHERE statement, together with a non-indexed column? I just want to check if matching a row is present or not, not actually retrieve information (WHERE ip='$ip' and datecurdate()) Thanks, Marco | | Marco Bleeker, Amsterdam | [EMAIL PROTECTED] | http://www.euronet.nl/users/mbleeker/ | | Attachments only after prior notice please. | Don't put me on any kind of mailing list. | | I am now receiving the Snowhite virus 4x a day | - some of you must be infected, please check ! | (No, you did not get it from me, I use Eudora) | __@ | _`\,_ |__(*)/ (*)Ah, op DIE fiets ! - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: KEY and index
They most certainly do depend on the table design and especially on the system which runs the test. They are my own figures... Daniel Åkerud wrote: In MySQL having a table that looks like this: idint primary key namechar(200) and making an index on name, will get you a 0.1 * original_retrieval_time when searching, but 1.5*original_insertion_time when inserting. It roughly means that (on my system that is) you should do at least one select statement for every 4000 inset statements, for the index to be profitable. So, keep in mind that an index wont allways suit you, but mostly. Where did you get this numbers from, are they some general factors or do they depend on the table design? //Eric - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: KEY and index
The manual also states that INDEX is a synonym for KEY, which means that they have identical funcationality. Daniel Åkerud - Original Message - From: Cal Evans [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Marco Bleeker [EMAIL PROTECTED] Sent: Friday, June 22, 2001 6:27 PM Subject: Re: KEY and index KEY is used to build other indexes. It's not short for Primary Key. There are PRIMARY KEY indexes, candidate key indexes (these COULD be a primary key but for one reason or another , are not) and just regular indexes. All tables should have a primary key. (I'm partial to adding an auto_increment field to almost every table of the name tableNameID and making this my primary key) Some tables will also have a candidate key. This is especially true if you manufacture a PK like I do. Then there may be a piece of data that is unique to each record and never null that would normally serve as a primary key. (The reason I manufacture PKs is because if a piece of data means something then it is always possible that it will change.This means that you would have to trace down all your FK relationships and change the data in those tables as well.SSN, phone number, email address are all examples of candidate keys but also smart keys. I never use them as PKs. ) Regular keys are just indexes, not necessarily unique, not necessarily on fields that don't accept nulls. Their primary function is to speed up data retrieval. Use them sparingly as they can have a negative impact on inserting and updating records. HTH, Cal * * Cal Evans * Senior Internet Dreamer * http://www.calevans.com * - Original Message - From: Marco Bleeker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 22, 2001 9:36 AM Subject: KEY and index Hello, I am learning MySQL and have a question. I know about the importance of the PRIMARY KEY statement, but I also see a KEY statement being used when creating a table. Is this just short for PRIMARY KEY, or what's the difference? Second question, when I have a large table, but with only 2 small cells per row (2 columns), is it useful to create a PRIMARY KEY, KEY, or INDEX for speed (there is no set relation to another table). Third question, when exactly does MySQL use indexes. Is it used when the indexed column is part of a (SELECT *) WHERE statement, together with a non-indexed column? I just want to check if matching a row is present or not, not actually retrieve information (WHERE ip='$ip' and datecurdate()) Thanks, Marco | | Marco Bleeker, Amsterdam | [EMAIL PROTECTED] | http://www.euronet.nl/users/mbleeker/ | | Attachments only after prior notice please. | Don't put me on any kind of mailing list. | | I am now receiving the Snowhite virus 4x a day | - some of you must be infected, please check ! | (No, you did not get it from me, I use Eudora) | __@ | _`\,_ |__(*)/ (*)Ah, op DIE fiets ! - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Error for the ' Syantax
Try mysql_query(INSERT into mybtd(co_pe) values('Johsua''s Brother')); or mysql_query(INSERT into mybtd(co_pe) values('Johsua\\'s Brother')); Daniel Åkerud - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 22, 2001 7:15 PM Subject: Error for the ' Syantax Dear sir; I have find a big error from MySQL. I have one fields like that; co_na(Fields) = Johsua's Brother; mybtd is the data name, co_na is the fields; I cannot insert the data by using the php commands; mysql_query(INSERT into mybtd(co_pe) values('Johsua's Brother')); canot be functioned. and also mysql_query(INSERT into mybtd(co_pe) values(Johsua's Brother)); but this command can be run on terminal use the command below:- INSERT into mybtd(co_pe) values(Johsua's Brother); can be run...But INSERT into mybtd(co_pe) values('Johsua's Brother'); cannot run... can you give me some help.. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
TCP/IP Sockets, UNIX Sockets
How do you force mysql to use either TCP/IP Sockets or UNIX Sockets? And how do you know which one it uses? It is for a performance analysis. Thanks! Daniel Åkerud
MySQL and replication?
Anyone has any experience with mySQL in combination with data replication? Are there products available out there that allows this? Thanks Daniel Åkerud
Re: MySQL 'locking up'
It's sad that your MySQL crashes. But still, it's even more sad that there exist human beings that rely on system administrators not being able to kill a process under linux ;) (don't take that too hard, just kidding) ps aux | grep mysqld get the PID of the process kill -9 PID Make sure you have the rights to do it. Daniel Åkerud Occasionally, MySQL seems to lock up on the Linux box and just sit there. It did it today for three hours before we realized it. When this happens, the only thing we know of to do is restart it, and this time it wouldn't shut down so we had to reboot the Linux box. Does anyone have any idea what causes this and what we can do to keep it from happening in the future? It's not a good thing when our customers who use MySQL databases suddenly can't access them. Thanks, Dawn H http://www.rdcss.com/ - RD Computer Solutions http://wow.cooncheese.com/ - WOW.CoonCheese.com http://dpenguin.rdcss.com/ - Cornucopia - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php