Re: Conditional in update

2014-02-12 Thread Larry Martell
On Wed, Feb 12, 2014 at 5:35 PM, wrote: > 2014/02/11 18:14 -0500, Larry Martell > set LIMIT = sign(LIMIT) * 100 * floor(0.01 + (sign(LIMIT) * LIMIT > * ratio/100) > > The function TRUNCATE can be useful here: > set LIMIT = TRUNCATE(LIMIT * ratio + 0.01 * sign(LIMIT), -2)

Re: Narrowing a SELECT statement by multiple hits

2014-02-12 Thread Larry Martell
On Wed, Feb 12, 2014 at 7:35 PM, Jennifer wrote: > Hello, > > I have the following SQL statement that I'd like to add to. It's > used to create a report that's emailed to me showing hits to our site that > didn't provide a referrer. However, I only want to report on multiple hits > fr

Narrowing a SELECT statement by multiple hits

2014-02-12 Thread Jennifer
Hello, I have the following SQL statement that I'd like to add to. It's used to create a report that's emailed to me showing hits to our site that didn't provide a referrer. However, I only want to report on multiple hits from the same IP address - not just a single hit by someone.

Re: Conditional in update

2014-02-12 Thread hsv
2014/02/11 18:14 -0500, Larry Martell set LIMIT = sign(LIMIT) * 100 * floor(0.01 + (sign(LIMIT) * LIMIT * ratio/100) The function TRUNCATE can be useful here: set LIMIT = TRUNCATE(LIMIT * ratio + 0.01 * sign(LIMIT), -2) , if it works as advertized. In any case, ABS(LIMIT)

Re: DBA: please review my.cnf [for Java Hibernate application] and give suggestions

2014-02-12 Thread Manuel Arostegui
2014-02-12 12:32 GMT+01:00 Lukas Lehner : > Hi Antonio > > all tables use InnoDB. The size is 27 GB (not yet in prod). I guess in prod > it will be fast 80GB. > Depending on how your application is going to use MySQL resources you will need to tweak some things (and not only MySQL). If it is goin

Re: DBA: please review my.cnf [for Java Hibernate application] and give suggestions

2014-02-12 Thread Antonio Fernández Pérez
Hi Lukas, In that case, such as Adarsh has said, you can configure until 70% of your RAM for innodb_buffer_pool_size. In your case, with 3GB RAM, I suggest you to configure until 2GB for MySQL: Minimal for MyISAM (Maybe 32MB), and the rest for InnoDB. Your problem will be loading data. Maybe your

Re: DBA: please review my.cnf [for Java Hibernate application] and give suggestions

2014-02-12 Thread Lukas Lehner
Hi it's also a Tomcat application server. Not dedicated MySQL instance. On Wed, Feb 12, 2014 at 11:28 AM, Adarsh Sharma wrote: > Is it a standalone DB server or Application is also hosted on top of it. > > You can give 50-70% of RAM to memory parameters like > Innodb_buffer_pool_size ( Innodb )

Re: DBA: please review my.cnf [for Java Hibernate application] and give suggestions

2014-02-12 Thread Lukas Lehner
Hi Antonio all tables use InnoDB. The size is 27 GB (not yet in prod). I guess in prod it will be fast 80GB. thanks On Wed, Feb 12, 2014 at 10:28 AM, Antonio Fernández Pérez < antoniofernan...@fabergames.com> wrote: > Hi Lukas, > > What is your default engine? In MySQL there are a lot of param

Re: DBA: please review my.cnf [for Java Hibernate application] and give suggestions

2014-02-12 Thread Adarsh Sharma
Is it a standalone DB server or Application is also hosted on top of it. You can give 50-70% of RAM to memory parameters like Innodb_buffer_pool_size ( Innodb ) and key_cache ( Myisam ) for mysql tables. Below link : http://mysql.rjweb.org/doc.php/memory will give you a brief idea. Thanks

RE: LIKE sql optimization

2014-02-12 Thread Zhigang Zhang
Done. Thand you very much! Zhigang _ From: Jesper Wisborg Krogh [mailto:my...@wisborg.dk] Sent: Wednesday, February 12, 2014 5:30 PM To: Morgan Tocker; Zhigang Zhang Cc: mysql@lists.mysql.com Subject: Re: LIKE sql optimization On 12/02/2014 13:16, Morgan Tocker wrote: Hi

Re: LIKE sql optimization

2014-02-12 Thread Jesper Wisborg Krogh
On 12/02/2014 13:16, Morgan Tocker wrote: > Hi Zhigang, > > On Feb 11, 2014, at 8:48 PM, Zhigang Zhang wrote: > >> I want to know the reason, in my opinion, to scan the smaller index data has >> better performance than to scan the whole table data. > I think I understand the question - you are as

Re: DBA: please review my.cnf [for Java Hibernate application] and give suggestions

2014-02-12 Thread Antonio Fernández Pérez
Hi Lukas, What is your default engine? In MySQL there are a lot of parameters that configure the engine behaviour. Depends on the engine, I suggest you to add some parameters or others. Also it's important to know the size of your data. Your configuration is minimal and by default is not optimal.

DBA: please review my.cnf [for Java Hibernate application] and give suggestions

2014-02-12 Thread Lukas Lehner
Hi We will use a Java application which uses Hibernate for DB calls. The vendor didn't made recommendations howto configure MySQL. The application is not yet in production. MySQL is new to me, I previously used Oracle DB. The vendor provided a guide howto configure Oracle. This is our my.conf $