Re: Recreate Table With Sorted Data

2007-08-15 Thread Martijn Tonies
John, > The solution was CREATE TABLE copyname SELECT * FROM originalname > > I was having problem with a PHP command that's not pulling what I want > from the table Ruling out random order for the rows was narrowing the > focus on the PHP problem. Have you not been reading what everyone said?

Re: Recreate Table With Sorted Data

2007-08-15 Thread John Kebbel
The solution was CREATE TABLE copyname SELECT * FROM originalname I was having problem with a PHP command that's not pulling what I want from the table Ruling out random order for the rows was narrowing the focus on the PHP problem. -- MySQL General Mailing List For list archives: http://lists

Re: Recreate Table With Sorted Data

2007-08-15 Thread Martijn Tonies
> > >Question 2: If not, what would the Insert/Select statement look like that > > would copy the records over in sorted order? > > > > > > Tables aren't sorted. Period. > > > > > > > > Only result-sets can be sorted. > > While that is true, strictly speaking, packing data into the same > physic

Re: Recreate Table With Sorted Data

2007-08-15 Thread Michael Dykman
> >Question 2: If not, what would the Insert/Select statement look like that > would copy the records over in sorted order? > > > Tables aren't sorted. Period. > > > > Only result-sets can be sorted. While that is true, strictly speaking, packing data into the same physical order as you expect to

Re: Recreate Table With Sorted Data

2007-08-15 Thread Dan Nelson
In the last episode (Aug 15), Martijn Tonies said: > >I have a table with 1600 student locks in random order. I would like > >them permanently sorted by the locker number they are assigned to. I > >assumed that ... > > > >~ I would copy the table under a different name > >~ Delete all records from

Re: Recreate Table With Sorted Data

2007-08-15 Thread Martijn Tonies
John, >I have a table with 1600 student locks in random order. I would like them permanently sorted by the locker number they are >assigned to. I assumed that ... > >~ I would copy the table under a different name >~ Delete all records from this copy >~ Write a statement that would copy the recor

Re: Recreate Table With Sorted Data

2007-08-15 Thread Wm Mussatto
On Wed, August 15, 2007 13:09, Kebbel, John said: > I have a table with 1600 student locks in random order. I would like them > permanently sorted by the locker number they are assigned to. I assumed > that ... > > ~ I would copy the table under a different name > ~ Delete all records from this co

Recreate Table With Sorted Data

2007-08-15 Thread Kebbel, John
I have a table with 1600 student locks in random order. I would like them permanently sorted by the locker number they are assigned to. I assumed that ... ~ I would copy the table under a different name ~ Delete all records from this copy ~ Write a statement that would copy the records from the

Re: Problem with a complex query

2007-08-15 Thread Hugo Ferreira da Silva
Hi, I've done some indexes in my tables and I solved my problem. But I still confused with indexes. I created one multiple index with the main 4 columns for mensagenspara's table. But it doesn't work. So, I created one index with 3 columns and one for each column, wich give me 4 indexes, and later

Re: run out of memory

2007-08-15 Thread B. Keith Murphy
So I stand corrected :) Sorry for the mis-information. Thanks Mark!! Keith - Original Message - From: "Mark Leith" <[EMAIL PROTECTED]> To: "Baron Schwartz" <[EMAIL PROTECTED]> Cc: "Michael Dykman" <[EMAIL PROTECTED]>, "Gu Lei(Tech)" <[EMAIL PROTECTED]>, "Jen mlists" <[EMAIL PROTECT

Re: run out of memory

2007-08-15 Thread Mark Leith
Baron Schwartz wrote: Mark Leith wrote: And in practice, a 32bit binary is actually limited to around ~2.5-2.7G, rather than a full 4G. What are the practical memory limits for 64-bit binaries? I have heard that MySQL's indexing code is only 32-bit safe anyway, and I assume for example the

Re: run out of memory

2007-08-15 Thread B. Keith Murphy
I have had the same type of problems as this user when unknowing using 32-bit code. That was why I was asking about what distro he was using. As for your question Baron - I don't think that limit is true (anymore). I am fairly certain that it use to be, but has been corrected. If everyone is rea

Re: run out of memory

2007-08-15 Thread Mark Leith
Baron Schwartz wrote: Mark Leith wrote: And in practice, a 32bit binary is actually limited to around ~2.5-2.7G, rather than a full 4G. What are the practical memory limits for 64-bit binaries? I have heard that MySQL's indexing code is only 32-bit safe anyway, and I assume for example the

Re: run out of memory

2007-08-15 Thread Baron Schwartz
Mark Leith wrote: And in practice, a 32bit binary is actually limited to around ~2.5-2.7G, rather than a full 4G. What are the practical memory limits for 64-bit binaries? I have heard that MySQL's indexing code is only 32-bit safe anyway, and I assume for example the MyISAM key buffers can

Re: run out of memory

2007-08-15 Thread Mark Leith
Michael Dykman wrote: > As most 64 bit libraries declare their 64-bitness clearly int heir > names, I think that there is a very high chance that you have built > yourself a 32-bit database in which case 4G is the limit of the known > universe. > > On 8/14/07, Gu Lei(Tech) <[EMAIL PROTECTED]> wrote

Re: Problem with a complex query

2007-08-15 Thread Michael Dykman
A word of caution: before you just throw FORCE INDEX at it, study your explains very carefully.. Most of the answers to your specific questions are in there.. run it on a server with lots of data, you will get very different results between small datasets and very large ones. - michael On 8/

Re: Can someone get help here????

2007-08-15 Thread Michael Dykman
It sounds like you are having an issue with collations.. have you read this? http://dev.mysql.com/doc/refman/5.1/en/charset-collations.html As for optimizing a column for LIKE: a normal index for a character field does indeed accelerate a LIKE expression of the form 'ABC%' where there is no varia

Re: run out of memory

2007-08-15 Thread Michael Dykman
As most 64 bit libraries declare their 64-bitness clearly int heir names, I think that there is a very high chance that you have built yourself a 32-bit database in which case 4G is the limit of the known universe. On 8/14/07, Gu Lei(Tech) <[EMAIL PROTECTED]> wrote: > try: > uname -a > to see if y

Re: Slow query involving ORDER BY

2007-08-15 Thread Baron Schwartz
Bob Pisani wrote: On another note, you should really change all of those ip address columns from varchar to int with the ip encoded as 4 bytes. You will save A LOT of space in both your index and table. And you should reduce the other varchar columns to the smallest amount possible. Right, grea

RE: Slow query involving ORDER BY

2007-08-15 Thread Bob Pisani
Couple of things to read that may help: http://dev.mysql.com/doc/refman/5.0/en/order-by-optimization.html http://hackmysql.com/case3 On another note, you should really change all of those ip address columns from varchar to int with the ip encoded as 4 bytes. You will save A LOT of space in both

RE: Problem with a complex query

2007-08-15 Thread Rhys Campbell
Does the other user_id have a lot of messages. I think MySQL will choose to table ignore the index if the retrieved rows are above 30% of the table total. Have you tried FORCE INDEX? -Original Message- From: Hugo Ferreira da Silva [mailto:[EMAIL PROTECTED] Sent: 15 August 2007 13:35 To: m

Re: Problem with a complex query

2007-08-15 Thread Hugo Ferreira da Silva
I found something weird. This is my query now -- (SELECT m.codmensagem, m.codprioridade, m.codusuario, m.codmensagemoriginal, m.codmensagempai, m.assunto, m.dataenvio, m.horaenvio, m.datalimite, m.horalimite, m.anexo, m.tipo, u.nome, up.nome as nomepara, mp.codrespondida, mp

RE: Problem with a complex query

2007-08-15 Thread Rhys Campbell
I solved a similar problem with a messaging system that was very slow because it was doing full table scan each time the query ran. I didn't have the chance to change the schema so this is what I came up with... SET @var = (SELECT MAX(message_id) FROM messages); SELECT columns... FROM message WH

Re: Scheduled events

2007-08-15 Thread Warren Young
Beauford wrote: Is there a way to run the following command via cron. $ man mysql -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Can someone get help here????

2007-08-15 Thread VeeJay
Hello there I have a problem. When I try to select some names starting with extra alphabets (Å Æ Ä Ö, etc), I simply don't get required results i.e., if I give a select command like: select * from employees where fname LIKE 'Å%'; I get results starting with English alphabet 'A' but not with 'Å'.