@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21



Comments:

<0> damir: You're better off finding a way for the process that populates the database to tell your script it's finished
<1> will[werk], you are answering with question
<1> SmashCat, interesting..
<2> damir, Because I don't agree with your logic.
<1> i dont have a logic, i have a problem
<2> I don't agree how you are going about your situation, that is causing your problem.
<1> you don't know what my situation is, how can you say this?
<2> You want PHP to wait for data. I'm saying don't have PHP wait.
<1> I don't care what you say, i am presenting you a problem here, you're telling me to avoid it, not to fix it.
<3> damir: sometimes the best way to fix a problem is to avoid it
<1> not in this case
<2> Why don't you explain what you are trying to do.
<0> I think I'll stick with my two queries anyway for now. There's a chance this will move to another dbms in the future so I'm trying not to put too much proprietary stuff in there. It would be nice if the FOUND_ROWS() command could just work in the first query though ;-)
<4> hey, what might be causing mysql (windows version) to max out the CPU with just insert statements? they are both insert on duplicate statements
<5> damir: PHP isn't inteded for sitting and waiting for things
<6> there is a solution - (1) dedcate a master and slave to this (2) read from the slave (3) block using the wait on master log pos



<4> I know it isn't the hard drive causing the problems (I even tried moving it into ram)
<1> my ajax is connecting to this php script trying to read data, if no data is available i want it to keep ajax idling as long as possible so it doesn't reconnect again...or if in the mean time data becomes available i want it to send to ajax
<6> but it's a terrible solution because it's a silly problem
<6> heh
<4> I also have both tables being used write locked manually
<6> you ajax will timeout
<1> sjrussel yea i just thought about this, i could have php connecting to something that is able to take all requests and block
<0> damir: The php script will eventually time out anyway.
<1> sjrussel, i know it will...its gonna reconnect automatic.
<6> heh
<6> do something else
<1> its called LivePage technique
<6> it's called, get a db that can handle the page loads.
<3> damir: i saw something about your problem on an ajax blog some days ago
<5> if you're using ajax, then why not do what you're trying to do in java
<0> damir: If there's no way to know when the data will be available, you'll have to just keep checking every X seconds.
<3> damir: use google :)
<1> bobesponja, trust me i have :P
<4> anyone have any ideas?
<7> how do i see what databases are registered with a mysql 4 server?
<8> show databases
<1> i am thinking about writing some kind of server, in perl maybe...eliminate database and use perl vars, then have php script connect to this server and check for data
<0> Jared555: I've heard there's some problem with the threading model on Windows. We have the same problem with a server. Doesn't happen with Linux. We're just ignoring it at the moment... ;-)
<0> (hopefully it'll convince the client to use Linux/Apache instead of Windows/IIS ;-)
<9> prophile: Ok... An index needs to be creaded on that BLOB column. Figure out how much of the blob should be used to compare and see if it is the same with another entry (between 1 & 255, if what I read is correct) and then do: ALTER TABLE fixlist ADD INDEX(description(100)); Of course description may not be your BLOB field, so you may want to change that, and 100 may not be the value you want, so change that. Then the previous key statemen
<4> SmashCat, even with 1 connection only?
<10> ta
<9> prophile: let me know if it works
<0> Jared555: It seems random for us. It's actually PHP using the CPU, not MySQL though.
<11> good day
<11> how do i get the ids of last affected rows?
<11> or see the rows that have been affected during the last query?
<12> hey, does anyone know how to use the update function on a primary key field ?
<6> just update it
<12> sjrussel, it says alteration complete, but when i view the data, nothing has changed
<11> is there a query that will show the last rows that have been updated?
<6> paste the query?
<2> !m Mr_Kyiv_ last insert id
<13> Mr_Kyiv_: (How to Get the Unique ID for the Last Inserted Row) : http://dev.mysql.com/doc/mysql/en/Getting_unique_ID.html
<11> thank you
<12> sjrussel sure,
<12> $queryUP = "UPDATE module_requisite SET Requisite_Code = '$New_Req_Code', Type_Of_Req='$Mod_Req_Type' WHERE Module_Code = '$Mod_Code' & Requisite_Code='$Old_Req_Code'";
<14> guy how do I show what user accounts I have created
<11> will[werk], is there a mysql query for that?
<15> use mysql;
<2> Did you read the page?
<4> what would be faster: mysql on linux inside of vmware on a opteron 175 with 2GB of ram, mysql on windows directly on the OS, sempron mobile 3000+ with 512MB of ram?
<6> print the actual queery, and see whcih of your vars ins'b beening interpolated
<4> (for just one connection that is using a ton of cpu)
<11> yes
<6> presumably not in VMWare
<2> Jared555, Your Opteron running Windows or Linux as the host?
<11> ok, last_insert_id() - does it work for last updated rows?
<2> I could have sworn that page explained everything...
<12> sjrussel, the actual query is here.
<12> UPDATE module_requisite SET Module_Code = 'TT3333A', Requisite_Code = 'BU1010A', Type_Of_Req='Pre-Requisite' WHERE Module_Code = 'TT3333A' & Requisite_Code='AA1234B' - Alteration Complete
<4> the opteron is windows 64 bit, unfortunately
<4> I am mainly wanting to compare mysql's performance vs this one program's flat file system with similar data, but I don't want to have to wait 10 years for the data to be loaded into mysql lol
<12> sjrussel, will the table type have anything to do with not being able to update primary keys ? its currently innodb
<5> i thought dropping indexes on MyISAM tables was always relatively fast... was I mistaken?
<16> how do i modify a string like exchange the three first chars to abc?



<6> Vyker, perhaps you need to commit the transaction?
<6> no
<12> sjrussel, commit the transaciton ?
<6> if it's innodb
<6> are you reading from the same transaction?
<12> sorry, what do you mean by "tranaction" ?
<6> !m Vyker transaction
<13> Vyker: (What Causes Transactions are not enabled Errors?) : http://dev.mysql.com/doc/mysql/en/Transaction.html
<6> !m Vyker ACID
<13> Vyker: (Transactions and Atomic Operations) : http://dev.mysql.com/doc/mysql/en/ANSI_diff_Transactions.html
<6> the latter
<12> sjrussel, thanks, ill get reading
<2> Jared555, The Semperon, is that on a notebook? Your performance is limited by your bottleneck, and in most cases, the hard drive. Depends on what kind of queries you are running. Notebooks usually have slower disks than PCs.
<12> sjrussel, i dont think thats what my problem is. from what ive gathered its to avoid multiple users updating.
<4> will, near 0 disk access
<4> mysql is using 80% cpu and apache 20%
<17> well if it's working on data chances are it has disk access
<17> and with the sempron having 1/4 of the ram of the other machine the chances of using disk is even bigger
<18> hey shabbs
<2> Jared555, I would **GUESS** that the Opteron would be faster.
<2> Why don't you want to run MySQL natively on it?
<17> hey Daveman
<4> will[werk], it would still be on windows
<2> Jared555, The VMware overhead is bad.
<19> it's been running this drop index for 35 minutes now...... zzzzzzzz
<20> hi... i have one field named created_on (yyyy-mm-dd) ... I want all rows that month/year is less than current month/year.. how do i do that?
<21> is it bad practice to have create a DB connection (as part of a multipage application) for displaying data for one page, then dropping the connection and re-creating one each time is being re-displayed (say, for changing the ORDER BY of the results)?
<9> eleftherios: There's a lot of overhead involved with creating a connection to the DB. Connection Pooling or Persistent Connections are always a better choice
<22> endikos wrong
<22> persisten connections are a cause of many problems
<2> endikos, In other DBs, that is likely. Not in MySQL.
<23> especially if you can use unix sockets
<9> What Problems? I've never seen a problem with it as long as my code was tight
<21> I am confused now. What shall I do?
<21> heh
<23> dont listen to endikos ..
<24> hide in a sock
<2> eleftherios, It probably doesn't matter.
<21> so shall I ***ume that it is ok to re-create a MySQL connection for each re-displaying of an HTML page with result data?
<9> SpComb and I seem to have the most reasoned resolutions. The others tell you what do to, but not why, other than "It's a problem".
<2> From a DB point of view. Your application might make a difference.
<12> does anyone know of any issues with updated primary key fields when using the UPDATE fucntion on innodb type tables ?
<23> there is a reason why there is no mysqli_pconnect()
<2> endikos, Where are your references on " There's a lot of overhead involved with creating a connection to the DB. " then?
<2> arjenAU_, Didn't you have some page regarding pconnects?
<23> http://de2.php.net/manual/en/features.persistent-connections.php
<23> i think this covers the good and the bad
<21> I am new to DB programming so I don't really know if creating & dropping lots of connections is ok.
<2> eleftherios, Language?
<22> very little overhead making connections
<9> Here's one for Java http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html. I'll look for one in PHP
<23> anyways .. for database like oracle .. it takes alot of time to create a connection
<21> will[werk], PHP
<23> this is not the case for mysql
<23> especially if the server is local
<21> lsmith, thanks for that link
<2> eleftherios, Don't use pconnects... It's not necessary. If it's all in one page, make one connection at the top, and let PHP close it when the script is done.
<23> eleftherios: like i said .. georg richter dropped persistent connections in the new mysqli extension for php
<21> lsmith, I think the web server and the mysql server are on the same machine
<23> and he did so for good reason
<21> will[werk], I have a cl*** that creates a connection and creates a whole HTML page, then (due to my lack of experience of this domain) each time the page gets re-displayed (for example because the user requests a change in the display order of the results or because of pagination) the script with this cl*** re-runs (as it calls itself). This means that everytime I create a connection, display, drop
<2> Java *could* be slightly different because you can be running an app and leaving a connection open as long as the app is running. PHP scripts generally finish within seconds.
<2> eleftherios, That is perfectly fine.
<21> phew
<21> I was getting a bit stressed over this as I can't come up with a different design
<2> Listen to lsmith, with his PHP references.
<23> i know my stuff :)
<2> HE KNOWS EVERYTHING.
<23> after all .. i am half east german, half iranian .. american adopted
<17> connections in mysql are cheap enough that it's ok to call 'em with each page load
<17> YOU'RE A TERRORIST
<2> I wonder how transactions, locks, and last_insert_id() works in a connection pool...
<17> all east germans are terrorists


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #mysql
or
Go to some related logs:

cp1251 to utf8 mysql
#perl
#php
anonib hidden
nforce4 gigabit nic debian module
#perl
rsync front end windows
#suse
#gentoo
gnome xinit.rc gentoo



Home  |  disclaimer  |  contact  |  submit quotes