Re: combined or single indexes?

2010-07-08 Thread Johan De Meersman
On Fri, Jul 9, 2010 at 7:30 AM, Neil Tompkins wrote: > > Should we be looking to create a index for all fields that we might be > perform a select condition in a where clause for ? It's a bit of trial and error, you have to weight the number of times you select based on a potential index vs. the

Re: combined or single indexes?

2010-07-08 Thread Neil Tompkins
Should we be looking to create a index for all fields that we might be perform a select condition in a where clause for ? On 9 Jul 2010, at 05:59, Johan De Meersman wrote: As many as you need, but no more :-) The right indexes give you a boost in select performance, but every index also

Re: There is a ram limit?

2010-07-08 Thread Johan De Meersman
This will mostly depend on your OS, really. Assuming you're running a 64-bit flavour of *nix on that box, I don't think you have to worry. On Fri, Jul 9, 2010 at 4:44 AM, Camilo Uribe wrote: > Hi: > > There is a limit in the amount of ram I could use for mysql? (I have a > server with 96GB of ra

Re: combined or single indexes?

2010-07-08 Thread Johan De Meersman
As many as you need, but no more :-) The right indexes give you a boost in select performance, but every index also needs to be updated when your data changes. On Thu, Jul 8, 2010 at 11:25 PM, Neil Tompkins wrote: > How many indexes are recommended per table ?? > > > > > On 7 Jul 2010, at 06:

table structure problem

2010-07-08 Thread Miguel Vaz
Hi, I am having some uncertainty while designing the following structure: I have two sets of data: * arqueology sites (can be natural): id name description id_category id_period x y * natural sites (can be arqueological also - bear with me -, so there will be duplicate records in the above ta

There is a ram limit?

2010-07-08 Thread Camilo Uribe
Hi: There is a limit in the amount of ram I could use for mysql? (I have a server with 96GB of ram) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: combined or single indexes?

2010-07-08 Thread Neil Tompkins
How many indexes are recommended per table ?? On 7 Jul 2010, at 06:06, "Octavian Rasnita" > wrote: Hi, MySQL can use a single index in a query as you've seen in the result of explain. Of course it is better to have an index made of 2 or more columns because it will match better the quer

Re: update replace() regex

2010-07-08 Thread Egor Shevtsov
Thanks Dan, I tested it just now. It works perfectly. Dan Nelson wrote: In the last episode (Jul 08), Egor Shevtsov said: I wonder if possible at all to use replace() together with regex in update statement. I want to be able to update a field of string values and replace a 'dash' character

Re: update replace() regex

2010-07-08 Thread Dan Nelson
In the last episode (Jul 08), Egor Shevtsov said: > I wonder if possible at all to use replace() together with regex in update > statement. I want to be able to update a field of string values and > replace a 'dash' character with a space in the string. Something like: > UPDATE table SET column =

update replace() regex

2010-07-08 Thread Egor Shevtsov
Hi ALL, I wonder if possible at all to use replace() together with regex in update statement. I want to be able to update a field of string values and replace a 'dash' character with a space in the string. Something like: UPDATE table SET column = replace(column, regex '%-%', ' ') where id

RE: Problem with IF() inside of a select statement

2010-07-08 Thread John Nichel
> -Original Message- > From: Peter Brawley [mailto:peter.braw...@earthlink.net] > Sent: Thursday, July 08, 2010 12:27 PM > To: mysql@lists.mysql.com > Subject: Re: Problem with IF() inside of a select statement > > >Is there a way I > >can do a IF((SELECT.), expr2, expr3) and have expr

Re: Problem with IF() inside of a select statement

2010-07-08 Thread Peter Brawley
Is there a way I can do a IF((SELECT.), expr2, expr3) and have expr2 populate with whatever is returned from the select statement? Yes, select if( (select count(*) from mytable ) > 100, 1, 0) works fine. The alias inside your last If(...), though, is not visible outside its parentheses;

Problem with IF() inside of a select statement

2010-07-08 Thread John Nichel
Hi, I'm hoping what I'm trying to do can be done, but I can't seem to find the right syntax. I have the following query: SELECT a.productid, a.productcode, a.product, if(