Re: Need help for performance tuning with Mysql

2012-05-23 Thread Alex Schaft
On 2012/05/24 04:10, Yu Watanabe wrote: 2. Instead INDEXes and schema design must be studied. Please provide: SHOW CREATE TABLE | thold_data | CREATE TABLE `thold_data` ( `id` int(11) NOT NULL auto_increment, `rra_id` int(11) NOT NULL default '0', `data_id` int(11) NOT NULL

Re: Need help for performance tuning with Mysql

2012-05-23 Thread Alex Schaft
On 2012/05/24 07:37, Alex Schaft wrote: You are selecting a record based on the value of data_id and thold_enabled, but don't have an index on either? Add an index for both. If data_id is unique, then you would only need an index on that. Alex On second thought, an index on thold_enabled

Re: 回复: Why is creating indexes faster after inserting massive data rows?

2012-05-07 Thread Alex Schaft
On 2012/05/07 10:53, Zhangzhigang wrote: johan Plain and simple: the indices get updated after every insert statement, whereas if you only create the index *after* the inserts, the index gets created in a single operation, which is a lot more efficient.. Ok, Creating the index *after*

Re: mixing and matching mysql mssql whileloop within an if case

2012-05-03 Thread Alex Schaft
I suppose an easier way is to have a getrow function, Something like while ($row = getrow($RS) { . . . } function getrow($RS) { if ($current_server_is_mysql) { return mysql_fetch_assoc($RS); } else

Batch update

2012-02-14 Thread Alex Schaft
Hi, I need to update a table along the lines of the following update table set LastUpdate=now(), UpdateSource='Abc' Where Key1 = 'Def' and Key2 = 'ghi' I need to possible do anywhere from 2 to 20 of these. Would it be better to call an update statement for each of these, or should I do a

Re: Batch update

2012-02-14 Thread Alex Schaft
On 2/14/2012 10:30 AM, cars...@bitbybit.dk wrote: On 14.02.2012 10:20, Alex Schaft wrote: Hi, I need to update a table along the lines of the following update table set LastUpdate=now(), UpdateSource='Abc' Where Key1 = 'Def' and Key2 = 'ghi' I need to possible do anywhere from 2 to 20

Re: C api mysql_store_result vs mysql_use_result

2012-02-09 Thread Alex Schaft
On 2012/02/09 01:40 PM, Johan De Meersman wrote: - Original Message - From: Alex Schaftal...@quicksoftware.co.za If I were to do a select count(*) from x where y prior to doing select * from x where y to get a number of records, how would this impact performance on the server itself?

C api mysql_store_result vs mysql_use_result

2012-02-08 Thread Alex Schaft
Hi, I'm currently using mysql_store_result to retrieve all records of a query. This poses a problem however if say a couple of thousand records get returned, and the user gets no feedback during the progress. I now want to change this to mysql_use_result. The only catch is that you don't

Re: Maximum line length or statement length for mysqldump

2011-10-22 Thread Alex Schaft
On 2011/10/21 10:26 AM, Johan De Meersman wrote: - Original Message - From: Alex Schaftal...@quicksoftware.co.za Got my app reading in a dump created with extended-inserts off, and lumping all of the insert statements together. Works like a charm Just for laughs, would you mind

Re: Maximum line length or statement length for mysqldump

2011-10-21 Thread Alex Schaft
On 2011/10/20 03:43 PM, Johan De Meersman wrote: - Original Message - From: Alex Schaftal...@quicksoftware.co.za I realize that, I'm just trying to stop the phone calls saying I started a restore, and my pc just froze I might just read all the single insert lines, and get a whole

Maximum line length or statement length for mysqldump

2011-10-20 Thread Alex Schaft
Hi, I'm monitoring a mysqldump via stdout, catching the create table commands prior to flushing them to my own text file. Then on the restore side, I'm trying to feed these to mysql via the c api so I can monitor progress (no of lines in the dump file vs no of lines sent to mysql), but the

Re: Maximum line length or statement length for mysqldump

2011-10-20 Thread Alex Schaft
On 2011/10/20 10:53 AM, Alex Schaft wrote: What can I pass to mysqldump to get more sane statement lengths? +1 for extended-inserts... -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Maximum line length or statement length for mysqldump

2011-10-20 Thread Alex Schaft
On 2011/10/20 11:54 AM, Johan De Meersman wrote: - Original Message - From: Alex Schaftal...@quicksoftware.co.za I'm monitoring a mysqldump via stdout, catching the create table commands prior to flushing them to my own text file. Then on the restore side, I'm trying to feed these to

Index question

2011-10-11 Thread Alex Schaft
If you have a table with columns A B, and might do a where on A or B, or an order by A, B, would single column indexes on A and B suffice or would performance on the order by query be improved by an index on A,B? Thanks -- MySQL General Mailing List For list archives:

Re: Index question

2011-10-11 Thread Alex Schaft
On 2011/10/11 02:22 PM, Rik Wasmus wrote: Just to clarify having key indexes of (a,b) or (b,a) have no difference ? They DO. See it as lookup table which starts with 'a' in the first case, and 'b' in the second one. Looking for anything that matches 'b' for an index (a,b) requires a full scan

Re: Index question

2011-10-11 Thread Alex Schaft
On 2011/10/11 02:30 PM, Alex Schaft wrote: On 2011/10/11 02:22 PM, Rik Wasmus wrote: Just to clarify having key indexes of (a,b) or (b,a) have no difference ? They DO. See it as lookup table which starts with 'a' in the first case, and 'b' in the second one. Looking for anything

Update table on lost connection

2011-09-28 Thread Alex Schaft
Hi, We're busy moving legacy apps from foxpro tables to mysql. User logins were tracked via a record in a table which the app then locked, preventing multiple logins for the same user code. I want to simulate this via a locked column in a mysql table, but would need the field to be cleared

Re: Import .dbf files

2011-07-19 Thread Alex Schaft
On 2011/07/19 09:52 PM, andrewmchor...@cox.net wrote: Hello I am about to create a database in mysql. I would like to be able to import some dbase3 (.dbf) files into the tables I will be defining. What is the easiest way to import the table. Is there software that can be downloaded that will

Index creation

2011-06-21 Thread Alex Schaft
Hi, I'm busy creating an index on a 518505 record table on a single column which is now taking about 2 hours on the copy to tmp table process The server is a 2gig ram Intel(R) Xeon(TM) CPU 3.00GHz running on a hardware raid 5. The inno config was left as a standard install from my-medium

recordset search question

2011-05-23 Thread Alex Schaft
Hi, I'm sure this must've been done before, so if someone can point me at a discussion or assist me in some other way I'd appreciate it. If I'm browsing a paged list of invoices say in numerical order and I then want to reposition the list on a certain client, I can do a second query to the