Re: Do NULL values slow down the database?

2007-03-29 Thread Ananda Kumar
So Jay, What benefit do we get if we only null columns in a separate table, since they are null, then there is not point in access this table. Please correct me , i am bit confused by this. regards anandkl On 3/30/07, Ales Zoulek <[EMAIL PROTECTED]> wrote: Thanks a lot. I agree with you in

RE: Querying large table

2007-03-29 Thread Brown, Charles
Just for heck of it, I did a Big-O-notation for its efficiency -- as you predicted, it will take longer. I also factored-in the SORT required by the 'GROUP BY' -- say there are 64,000 categories therefore mysql may have to do 64,000 SORTs -- that's not cheap. My gut feelings are its doing a T/B

Re: Do NULL values slow down the database?

2007-03-29 Thread Ales Zoulek
Thanks a lot. I agree with you in meaningful separating columns into tables as you descibed it. I had just impression, that mysql have some inner algoritmic issue with dealing with NULL values. Rgrds. Ales On 3/29/07, Jay Pipes <[EMAIL PROTECTED]> wrote: Ales Zoulek wrote: > Hi, > > I've read

RE: Querying large table

2007-03-29 Thread Michael Gargiullo
Do you need a count for all and run one at a time? If so, try. Select ctg as catagory,count(*) as count from items group by catagory. It will take a little while to run, but return all of your counts. Does the items table have an index in ctg? Sent by Good Messaging (www.good.com) -O

Querying large table

2007-03-29 Thread Shadow
Hey, guys. I have 2 tables: categories and items. COUNT(*) categories = 63 833 COUNT(*) items = 742 993 I need to get number of items in a specific category, so I use SELECT COUNT(*) FROM items WHERE ctg='' But each query takes ~ 10seconds. Its really slow. Can anybody propose some optimization?

Re: Do NULL values slow down the database?

2007-03-29 Thread Jay Pipes
Ales Zoulek wrote: Hi, I've read reacently, that it's not good to use columns with NULL values in MySQL, because it slows down the select queries over that columns. Is it true? Or do that affects only some situations or some versions? Are there some relevant statistics about that? There is not

RE: Help With a Week ( date ) query

2007-03-29 Thread Jim Ginn
Jerry: We do this exactly at: http://www.WeeklyRentals.com Jim > I'm not sure if this gets you all the way, or not. > > There is a WEEK() function that converts a date into its week of the year. > There isn't any obvious way to turn it back into a date, but it doesn't > sound like you need it f

Re: convert duration(mediumint) to hours and minutes

2007-03-29 Thread Michael Dykman
this will format that value inline. select concat(floor(pr_id / 60),':',mod(pr_id,60)) AS mytime from ... If you are running 5.0+ you may want to push this down into a UDF - michael On 3/29/07, Reinhart Viane <[EMAIL PROTECTED]> wrote: Hello list, I have a table events in a database that has

Field names truncated.

2007-03-29 Thread Mahmoud Badreddine
I recieved a database structure from a certain piece of software and I exported all the tables to MySQL, only to find out that the field names were cut short. How can I make sure that the field names is large enough to accomodate the longest field header? Thank you. -- -Mahmoud Badreddine http:/

Re: information_schema not found

2007-03-29 Thread Paul DuBois
At 12:30 PM -0500 3/29/07, Brown, Charles wrote: Hi all. I just finished installing mysql on a new server. I noticed that database information_schema wasn't found. Can someone help me. What version of MySQL? I_S is present only in 5.0 and up. -- Paul DuBois, MySQL Documentation Team Madison,

information_schema not found

2007-03-29 Thread Brown, Charles
Hi all. I just finished installing mysql on a new server. I noticed that database information_schema wasn't found. Can someone help me. This message is intended only for the use of the Addressee and may contain information that is PRIVILEGED and CONFI

RE: Help With a Week ( date ) query

2007-03-29 Thread Jerry Schwartz
I'm not sure if this gets you all the way, or not. There is a WEEK() function that converts a date into its week of the year. There isn't any obvious way to turn it back into a date, but it doesn't sound like you need it for your particular application. SELECT * FROM specials WHERE WEEK(NOW(), 7)

Help With a Week ( date ) query

2007-03-29 Thread Joey
Hi Guys, I'm kind of at a standstill in coming up with how to get a query I need to write. I'm trying to find a record which matches the week we are in. Example today is Thursday the 29th, it is within the week which has the 26th through the 1st, and if the day is within this week display the reco

Do NULL values slow down the database?

2007-03-29 Thread Ales Zoulek
Hi, I've read reacently, that it's not good to use columns with NULL values in MySQL, because it slows down the select queries over that columns. Is it true? Or do that affects only some situations or some versions? Are there some relevant statistics about that? Thanks a lot, Ales On 3/29/07,

convert duration(mediumint) to hours and minutes

2007-03-29 Thread Reinhart Viane
Hello list, I have a table events in a database that has a field named duration. This field is a mediumint containing an amount of minutes (eg 65, 87, 10368) Now I need these to be outputted into a h:mm (so 65 will be represented as 1:05) My complete query is: select YEAR(events.workdate) as they

Re: Problem on creating root password

2007-03-29 Thread Duncan Hill
On Thursday 29 March 2007 11:38:21 Stephen Liu wrote: > > http://dev.mysql.com/doc/refman/4.1/en/resetting-permissions.html > > I tried learning resetting the password according to above URL. I > can't find "set" command on this box. I don't know which package > provides it so finally I surrende

Re: Problem on creating root password

2007-03-29 Thread Stephen Liu
--- Chris <[EMAIL PROTECTED]> wrote: - snip - > So you *have* set the root password before. > > From your previous emails: > > # mysqladmin -u root password yourrootsqlpassword > > That set the password to "yourrootsqlpassword". > > > > If you need to reset it, see documentation: > > http

Re: master and slave in same machine

2007-03-29 Thread Maciej Dobrzanski
In news:[EMAIL PROTECTED], "Rilawich Ango" <[EMAIL PROTECTED]> wrote: > I found the the position in "show master status" also keep as 98 but I > am sure the replication from S2 to S1 works. It seems that S2 master > hasn't started yet. If by that you mean that you want the changes made on S1 to

Re: Problem on creating root password

2007-03-29 Thread Maciej Dobrzanski
In news:[EMAIL PROTECTED], satimis <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] ~]# /etc/init.d/mysqld restart > Stopping MySQL: [FAILED] > Starting MySQL:[ OK ] Ok, lets try it a different way, using only th

Re: Problem on creating root password

2007-03-29 Thread Chris
[EMAIL PROTECTED] ~]# mysqladmin -u root password xyz mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)' * end * So you *have* set the root password before. From your previous emails: # mysqladmin -u root password yourro