Re: C api mysql_store_result vs mysql_use_result

2012-02-09 Thread Johan De Meersman
- Original Message -
 From: Alex Schaft al...@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? Would the first query be the one to
 do the most processing, with the second one being faster, or would both
 have to do the same amount of work?

Heh. The amount of work put into parsing and executing would be the same, 
except if you can compose your count query to use only indexed fields.

Easily checked with an explain of both queries, I'd say.

Also, do consider if you really need a %complete progress indicator, or if a 
simple record counter with no indicated endpoint will do. That is, do your 
users need to know how long it's going to take, or do they just want assurance 
that the process didn't hang?


-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



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? Would the first query be the one to
do the most processing, with the second one being faster, or would both
have to do the same amount of work?

Heh. The amount of work put into parsing and executing would be the same, 
except if you can compose your count query to use only indexed fields.

Easily checked with an explain of both queries, I'd say.

Also, do consider if you really need a %complete progress indicator, or if a 
simple record counter with no indicated endpoint will do. That is, do your 
users need to know how long it's going to take, or do they just want assurance 
that the process didn't hang?


From the user's perspective, they just need to know the process didn't 
hang. The count() query is more for getting memory requirements upfront. 
Can I handle it all, or do I need to break it down into pages?



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql

conditional updating

2012-02-09 Thread william drescher
I want to update a date field in a record. if the date in the 
field is -00-00 I want to change it to the current date.  I 
would appreciate suggestions or links on how to do this.


Yup, tried reading the manual, but need a bit of help.
I will be updating another field at the same time.

bill


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: conditional updating

2012-02-09 Thread Michael Dykman
untested:

update  set mydate = IF(mydate =  '-00-00', now(), mydate)

 - michael dykman

On Thu, Feb 9, 2012 at 8:14 AM, william drescher
will...@techservsys.com wrote:
 I want to update a date field in a record. if the date in the field is
 -00-00 I want to change it to the current date.  I would appreciate
 suggestions or links on how to do this.

 Yup, tried reading the manual, but need a bit of help.
 I will be updating another field at the same time.

 bill


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:    http://lists.mysql.com/mysql




-- 
 - michael dykman
 - mdyk...@gmail.com

 May the Source be with you.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: conditional updating

2012-02-09 Thread Johnny Withers
Update table set mydate=now() where mydate='-00-00'; should do it.

Sent from my iPad

On Feb 9, 2012, at 7:15 AM, william drescher will...@techservsys.com wrote:

 I want to update a date field in a record. if the date in the field is 
 -00-00 I want to change it to the current date.  I would appreciate 
 suggestions or links on how to do this.

 Yup, tried reading the manual, but need a bit of help.
 I will be updating another field at the same time.

 bill


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: C api mysql_store_result vs mysql_use_result

2012-02-09 Thread Johan De Meersman


- Original Message -
 From: Alex Schaft al...@quicksoftware.co.za
 
 From the user's perspective, they just need to know the process didn't
 hang. The count() query is more for getting memory requirements upfront.
 Can I handle it all, or do I need to break it down into pages?

Then just use the cursor-based api (I guess that's mysql_use_result) all the 
time, and you won't have any memory problems at all. If you need to retrieve 
pages (as in, the third block of 10 results, for instance) LIMIT is your 
friend. Do read the documentation on limit, though - there's performance 
caveats when you use order by and similar.


-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: conditional updating

2012-02-09 Thread william drescher

On 2/9/2012 8:22 AM, Johnny Withers wrote:

Update table set mydate=now() where mydate='-00-00'; should do it.

 can't do that because the record is selected by other criteria.
Thanks

bill



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: conditional updating

2012-02-09 Thread Reindl Harald


Am 09.02.2012 14:55, schrieb william drescher:
 On 2/9/2012 8:22 AM, Johnny Withers wrote:
 Update table set mydate=now() where mydate='-00-00'; should do it.
  can't do that because the record is selected by other criteria.

so explain the criteria, show us the query

usually you do exatcly the same WHERE as for the select and add
and mydate='-00-00'



signature.asc
Description: OpenPGP digital signature


Re: conditional updating

2012-02-09 Thread william drescher

On 2/9/2012 8:18 AM, Michael Dykman wrote:

untested:

update  set mydate = IF(mydate =  '-00-00', now(), mydate)

  - michael dykman



Thank you very much !

bill

On Thu, Feb 9, 2012 at 8:14 AM, william drescher
will...@techservsys.com  wrote:

I want to update a date field in a record. if the date in the field is
-00-00 I want to change it to the current date.  I would appreciate
suggestions or links on how to do this.

Yup, tried reading the manual, but need a bit of help.
I will be updating another field at the same time.

bill


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql









--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: conditional updating

2012-02-09 Thread Johnny Withers
So, add your other criteria to the where clause, you failed to say
there were other conditions in your first email.

Sent from my iPad

On Feb 9, 2012, at 7:56 AM, william drescher will...@techservsys.com wrote:

 On 2/9/2012 8:22 AM, Johnny Withers wrote:
 Update table set mydate=now() where mydate='-00-00'; should do it.
 can't do that because the record is selected by other criteria.
 Thanks

 bill



 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: conditional updating

2012-02-09 Thread Michael Dykman
He did mention that there was another field he was updating, which
implies that the state of the date field was not the only condition.

 - michael

On Thu, Feb 9, 2012 at 9:22 AM, Johnny Withers joh...@pixelated.net wrote:
 So, add your other criteria to the where clause, you failed to say
 there were other conditions in your first email.

 Sent from my iPad

 On Feb 9, 2012, at 7:56 AM, william drescher will...@techservsys.com wrote:

 On 2/9/2012 8:22 AM, Johnny Withers wrote:
 Update table set mydate=now() where mydate='-00-00'; should do it.
 can't do that because the record is selected by other criteria.
 Thanks

 bill



 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:    http://lists.mysql.com/mysql


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:    http://lists.mysql.com/mysql




-- 
 - michael dykman
 - mdyk...@gmail.com

 May the Source be with you.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Tuning mysql

2012-02-09 Thread Giovanni Bechis
Grant emailgr...@gmail.com wrote:
 I'm running mysql on Gentoo with 4GB RAM and I'm wondering if I should
 change any settings.  I'm using mysql with a website on the same
 server so I have skip-networking, and I increased key_buffer and
 innodb_buffer_pool_size from 16M to 256M.  Everything else is default.
 Should I consider changing these or any other settings?
 
pt-variable-advisor from percona-toolkit 
(http://www.percona.com/downloads/percona-toolkit/2.0.3/)
 Giovanni
-- 
/*
 * SnB - Hosting and software solutions
 * http://www.snb.it
 */


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Tuning mysql

2012-02-09 Thread Michael Dykman
Good advice, all of it.  What hasn't been said and should be noted: in
most cases, the bottleneck is the queries themselves.  You will
generally get a lot more boost from tuning those than from any
configuration tweaking (excepting the pathological cases).

 - michael dykman


On Thu, Feb 9, 2012 at 10:52 AM, Giovanni Bechis bi...@snb.it wrote:
 Grant emailgr...@gmail.com wrote:
 I'm running mysql on Gentoo with 4GB RAM and I'm wondering if I should
 change any settings.  I'm using mysql with a website on the same
 server so I have skip-networking, and I increased key_buffer and
 innodb_buffer_pool_size from 16M to 256M.  Everything else is default.
 Should I consider changing these or any other settings?

 pt-variable-advisor from percona-toolkit 
 (http://www.percona.com/downloads/percona-toolkit/2.0.3/)
  Giovanni
 --
 /*
  * SnB - Hosting and software solutions
  * http://www.snb.it
  */


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:    http://lists.mysql.com/mysql




-- 
 - michael dykman
 - mdyk...@gmail.com

 May the Source be with you.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: conditional updating

2012-02-09 Thread Johnny Withers
It implied to me there were two fields to update based on the date
being a given value. Read it how you like.

Sent from my iPad

On Feb 9, 2012, at 9:34 AM, Michael Dykman mdyk...@gmail.com wrote:

 He did mention that there was another field he was updating, which
 implies that the state of the date field was not the only condition.

 - michael

 On Thu, Feb 9, 2012 at 9:22 AM, Johnny Withers joh...@pixelated.net wrote:
 So, add your other criteria to the where clause, you failed to say
 there were other conditions in your first email.

 Sent from my iPad

 On Feb 9, 2012, at 7:56 AM, william drescher will...@techservsys.com wrote:

 On 2/9/2012 8:22 AM, Johnny Withers wrote:
 Update table set mydate=now() where mydate='-00-00'; should do it.
 can't do that because the record is selected by other criteria.
 Thanks

 bill



 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql




 --
  - michael dykman
  - mdyk...@gmail.com

  May the Source be with you.

 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



About mysql++3.1.0 SET TRANSACTION ISOLATION LEVEL

2012-02-09 Thread 陈秋丰
 Hello:
   I foud a question about function of transaction.
   In this function switch not have break

Transaction::Transaction(Connection conn, IsolationLevel level,
   IsolationScope scope, bool consistent) :
conn_(conn),
finished_(true)   // don't bother rolling it back if ctor fails
{
 // Set the transaction isolation level and scope as the user wishes
 Query q(conn_.query(SET ));
 if (scope == session) q  SESSION ;
 if (scope == global)  q  GLOBAL ;
 q  TRANSACTION ISOLATION LEVEL ;
 switch (level) {
   case read_uncommitted: q  READ UNCOMMITTED;
   case read_committed:q  READ COMMITTED;
   case repeatable_read:q  REPEATABLE READ;
   case serializable:  q  SERIALIZABLE;
 }
Qiufeng Chen

陈秋丰
360平台研发部
[说明: 说明: 说明: 说明: 2-1-26 邮件格]

电话:13693389017
飞信:13693389017
邮件:chenqiuf...@360.cn
地址:北京朝阳区建国路71号惠通时代广场C座202 100025



Installing Mysql-Workbench

2012-02-09 Thread Adarsh Sharma

Dear All,

I researched about data modelling  designing Schema diagrams  need a 
tool to design Schema diagrams.
Today i download the source code of Mysql-Workbench ( 
mysql-workbench-gpl-5.2.37-src ), but when i run the ./configure command 
i am facing the below issue :-



checking for GNOME... configure: error: Package requirements (gtkmm-2.4 
= 2.12) were not met:


Requested 'gtkmm-2.4 = 2.12' but version of gtkmm is 2.10.10

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GNOME_CFLAGS
and GNOME_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.


I know I need to meet some dependencies , and is there any link that 
first installs all dependencies 7 then mysql-workbench because my yum 
install dependencies does not find the corresponding packages.



Thanks in Advance.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql