| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Comments:
<0> blahdy: but maybe you can combined it into 1 subselect <1> lokus: How so? <0> blahdy: SELECT COUNT(*) as track_count_played, music_track_id as track_id FROM music_plays WHERE DATE_SUB(NOW(),INTERVAL 180 MINUTE) <= created_at GROUP BY music_track_id <1> lokus: I think that might have worked :) Let me paste you the updated version, hold on. <2> lokus, my query makes a GROUP BY `idc`, but can i get also the grand total without make a second query ? <0> blahdy: maybe some of the left join is not necessary, inner join may do, but I am not sure <0> HeliosTech: ROLLUP <1> lokus: Here's the updated paste. http://rafb.net/paste/results/BDfOwZ81.html <0> blahdy: so, what is the problem, I actually did not read the description of what you want <0> blahdy: so does it work? <1> yes, your updates work just like the old verison, only yours is cleaner... <1> i wish i could get rid of the other subselect... <1> i saw this http://dev.mysql.com/doc/refman/4.1/en/rewriting-subqueries.html, but haven't figured out how to do it <0> blahdy: next, you may want to check if you really need the left join, or would inner join do <0> blahdy: not likely to work with yours due to the group by <0> blahdy: and yours is a derived table
<0> blahdy: only those of the pattern described in the manual can be rewritten <1> lokus: That's ok, I just appreciate your help in getting this far...I'm not a SQL expert, but learning quickly. <3> hi <3> anyone know how to check if mysql is running correctly on my machine <4> windows/unix? is/are the daemon process(es) running? can you use `mysqladmin status` without an error? <3> unix <3> linux <3> im using apache <4> have you ever been able to get mysql working on this box... or is it your first time setting it up? <4> and on a completely different note... has anybody setup a mysql-max cluster before? I understand the nodes should all ideally share the same large amount of RAM... but in a high-load environment, which type of node would benefit from the additional horsepower: the Data node, or the SQL node? <4> something tells me the data/storage nodes are mostly just men-in-the-middle to keep track of changes... and the SQL nodes pull the most recent data from the Storage nodes, and crunch accordingly. <5> quick design question... I have a forum that I want to add the ability for users to upload files to a specific message. Now if the message exists, its easy to upload files and keep track of them by the messages's id. The question is how can I have users upload files before they actually post their message... before they post their message, I don't have an id to tie the files to <0> TheChronoTrigger: create the message in advance and then update it <6> I want to use mysqldump on a production system but I can't have it lock the tables... Now looking through the various options I found --opt. Am I correct in my interpretation of it that it locks all the tables while doing the dump? <7> Yes. It includes '--lock-tables'. <6> Thank you. <0> it locks all table in the database it is dumping, 1 database at a time if you dump more than 1 database <0> does opt include lock-tables? <0> oh it does <8> Hello folks <8> How can I kill active mysql processes on cli, in mysql console? I'm logged in as root <0> kill <8> just kill? <5> lokus.. thanks. So as soon as a user starts to upload a file, create a message in my message table, and then update it after the user attempt to really post the message? <0> TheChronoTrigger: eys <0> TheChronoTrigger: yes <0> !m Haris kill <9> Haris: (KILL Syntax) : http://dev.mysql.com/doc/mysql/en/KILL.html <5> what if the user uploads a file and never hit the "post message". Wouldn't I end up with a orphaned message? <0> TheChronoTrigger: you end up with orphan file uploaded too :) <5> >< <0> TheChronoTrigger: keep a flag in the incomplete message and you can then run something to clean it up <5> yeah... that is what I was thinking about. When I create the temp message, I won't ***ign it a topic until the user posts the message... that way the message won'[t pop up until the message is posted and I can check for NULL topic id's later to remove orphaned messages and files <5> thanks :) <8> lokus: kill process-number; is not working <8> it says the query was executed succesfully, but the process is still running. <0> Haris: does it show in SHOW PROCESSLIST <8> lokus: I'v tried it on 4 differentp processes <8> lokus: Ofcourse! <8> mysql> kill 21774; <0> Haris: it may take a while to kill it if the process is doing something, I am not sure if it will wait till it finish the current work or not <8> Query OK, 0 rows affected (0.01 sec) <8> | 21764 | car | localhost | car_db | Killed | 28759 | Removing duplicates | SELECT DISTINCT ((((acos(sin( (29.957519*PI())/180 ) * sin( (LATITUDE*PI())/180 ) + cos( (29.957519* | <0> there, killed <8> the process is still running, taking up 400% cpu <8> load averages: 4.19, 4.44, 4.51 <8> it was half yesterday with the half the ammount of the same query. <8> There, I restarted the daemon <8> But why didn't kill work on mysql 4.0.24? <8> Some 5-10mins. must'v p***ed between me trying to kill it through cli, 2-4 times, then running phpmyadmin remotely, logging in, killing it frmo there many times, the comming back and trying it on cli again. Still it didn't kill the process <10> Haris, That is not "400% CPU"... <8> will_ Do you want me to put forward the results from top as well? <8> regardless! <10> Yes, and you will see it only goes to 99%. <10> <8> load averages: 4.19, 4.44, 4.51 <-- like you said, load averages. Not 400% CPU. <8> man uptime doesn't give me a clue. top told me 2.x load average was actually 200% cpu being used by mysql yesterda <8> *yesterday <10> How does your CPU do twice the amount of work? <10> top did not tell you 2.x means 200% CPU. <10> Load is exactly that. Load. How many threads/processes waiting to be ran. <8> 200 was showing up adjacente to mysql process row in top's listing under the cpu column
<5> lokus.. are you still around? <11> how can i update multiple columns at a time (in a single query)? <11> is there nobody to answere my question/ <5> Cacious... UPDATE table_name SET col1 = value1, col2 = value2 WHERE somecol = somevalue; <11> TheChronoTrigger: thanks dude <5> :) <12> hi. I have a table with date column (type and name of the column). Since some time I have record for every single day till now. How could I check if I missed some day. for example. 2006-05-23 and next row 2006-05-25. <12> asking about select query if possible . I know how to do it with a script <12> using mysql 4.1.11 <0> jmut: create another table with all the dates, 1 for each day and then do a left join to find dates which does not have any match <12> but I will need a script again to insert this table with all the dates. they date back to august 2005 <12> I guess it could noto be done without using a script. maybe with mysql 5.0 it could. anyhow 10x for the answer <0> jmut: maybe do a self join, and match date = date + 1 day, but you need to get the reverse of this <0> jmut: still this is not good enough <12> lokus: not sure what you mean with this reverse stuff. <0> jmut: nevermind, it probably not going to work <0> jmut: you cannot select things that are not in the table, as in date that does not exist <4> hey lokus, have you ever played around with mysql clustering? <13> Hello. My hostee's mysql sserver is running at GMT -4:00. How can I make it so it really would be GMT +0, and i use NOW() functions etc. <0> marc7: not much, read on it a bit <13> my mysqlclient is php-mysql lib. <4> i am... I'm trying to figure out what would happen if the management node running mgmd, died. <12> lokus: :) I guessed so....but still. Can't blame me for asking :) <4> and how I could look at integrating that into a linux-ha cluster. <4> really crazy stuff that the manual probably won't cover. <14> is anyone in here knowledgeable with preparing pdf files for print <15> : ) <16> is there any iff syntax in sql <16> is there any iff syntax in sql? <16> anyone there? <17> netdown: if() ? <16> its iff <17> what is iff? <16> if and only if <17> what is the difference from regular if? <18> hey all, I'm a bit stuck on an SQL statement... I'm trying to select an url stored as a varchar from a table where it contains id=1 or id=2 etc. however it, obviously returns id=10 and id=20 as well, how can I get around this? <18> (bearing in mind it could be the end of the url but also could have another variable after (e.g. id=1&page=10) <17> um, why is it 'obviously returns'? <17> use REGEXP instead of LIKE <17> then <18> well I was doing LIKE '%...%' <17> exactly, so what is wrong? <17> server returned you what you asked <17> use REGEXP instead of LIKE <18> I know <18> but not what I want =) <17> so what do you want? :) <19> Hi All. I could not connect to mysql from php command line can any on help me <18> to match id=X but not id=X0 or id=X1... etc. <18> so it can be id=X^ or id=X\& I guess? <20> what are the user/group ownership suppose to be for /var/lib/mysql? <20> because im having root:www-data which i think is bad. isn't it suppose to be mysql there? <18> dorel_: mysql/mysql on debian <20> right thanks <18> domas: url REGEXP '^.*id=X$' OR url REGEXP '^.*id=X&.*$' <18> does that look right to you? <17> maybe <17> :) <17> you can put it into single expression though <21> nyone use ibwebdmin before? <18> domas: how's that? <17> ^.*id=X($|&.*$) <17> something like that <17> *shrug* <18> thanks <18> how about: url REGEXP '^.*id=X(($)|(&.*$)' <22> Is there some way in mysql to insert a certain value into a table only if it does not exist already? <22> I see a REPLACE command which inserts if the value is absent and overwrites if the value is present, which is useful, but not exactly what i wanted. <0> insert ignore <22> ok... i'm looking at that, but the manual says: "If you use the IGNORE keyword, errors that occur while executing the INSERT statement are treated as warnings instead." <22> That sounds slightly different. Am I missing something? <23> mccbaka: well if you replace and you insert the same values <23> it will probably not do anything
Return to
#mysql or Go to some related
logs:
denyhosts vs fail2ban kubuntu dapper via refresh rate eithelonnen fedora 2 eth0 device not found #linux #fedora gentoo SATA vaio detected ubuntu make-kpkg suspend2 192.168.5.9/
Moromite
|
|