Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Slow Log File Has Times In Whole Seconds But Mysqldumpslow Has Fractions Of Seconds?


When I look at the mysql-slow.log file itself that I've set up, it lists times in whole seconds. However, when i run mysqldumpslow to parse that same log file, it shows times in fractions of seconds. The info from mysqldumpslow seems correct, but I can't figure out where it gets its info. Where is it coming from?




View Complete Forum Thread with Replies

Related Forum Messages:
Seconds Between 2 Dates - Why Does Seconds Jump By 40 Seconds?
I have a table for my sessions and basically i wanna check seconds between NOW() and when it was created.

I noticed that at every minute the seconds would jump by at least 40 seconds for every minute.

So if i created a new sesson on my site and Log NOW() into created

then i try doin SELECT (NOW() - created) AS created_sec

I was monitoring it because my site would log me out all the time. So I noticed at every minute it seems that it always jump 40seconds or more for every minute.

Here is table:...

View Replies !
How Many Seconds Query Took?
I'm sure this is one of the easiest questions to answer, but how to you know how many seconds it took to query the database? I noticed it on the command-line client and on a lot of forums.

View Replies !
Convert From Seconds To HH:MM:SS
Is there an easy way of converting a number (integer) into it's equivalent hh:mm:ss,

e.g. if the entry is 5400 then it would convert to 01:30:00 (e.g. one and a half hours).

View Replies !
Changing Value After 30 Seconds?
Is there a way to change a value after 30 seconds of it being changed? So if I change it to 1 from an external script, I want to 30 seconds later to change to 0. Is this possible without a script (or a script in sql of some sort?)?

View Replies !
Minutes & Seconds Only
I only want to store minutes & seconds for DVD chapter times, i.e., 3:10, or :24.

Should I use TIME,

View Replies !
Adding Seconds In TimeStamp
I have a table that contains an "interval" column and a timestamp column. I want to set the default value for the timestamp column to be the current timestamp plus the interval column which is a value in seconds.

View Replies !
Add Seconds To Current Time
I am trying to create a statment to add a given time in second to the current time like this:

update tags.triggers set next_interval=(addtime(curtime(),300)) where id=1;

This statment adds 3 minutes to the current time. How can I add 300 seconds to the current time?

View Replies !
SELECT Takes 20 Seconds
I am having trouble speeding up a SELECT statement from a table with 1,764 records.
I tried myisamchk --sort-index --sort-records=1 but this did not help (is a Primary key enough?).

Things were fine at around 1200 records but went downhill after 1700. I am using MySQL 3.23.42 on HP/UX 11.11 and PHP 4.3.4. Any tips on how to speed things up?

View Replies !
Mysql Does Not Respond For Several Seconds.
I have created a new database-driven website. I've installed php 5.1.1 and mysql 5.0
I'm working with the Mysqli connector.

Everything works fine. Except when a user starts tampering the website by continuously hitting the F5 button.

On the intro-page of the website, a lot of queries are being fired against the database. When the user hits F5 quickly for, let's say, 50 times the database times out and I get the ugly error:

"Warning: mysqli::mysqli() [function.mysqli]: (HY000/2003): Can't connect to MySQL server on 'localhost' (10048) in..."

After the database 'hangs' and I am unable to connect to it for at least 30 seconds...

Any idea why the tampering makes my database go down for a few secs ?

View Replies !
Is It Possible To Bypass 30 Seconds Time Out
hello im importing quite a large amount of .sql scripts into mysql and everytime i get this error

Fatal error: Maximum execution time of 30 seconds exceeded in www.*******

is it possible to alter this default timeout to a longer timeperiod and if so how is it done,

im using MySQL v5.0.27, together with PHP v5 and phpmyadmin v2.9.03

View Replies !
Insert Row With NOW() Plus Twenty Seconds?
Is there any way you can state in your INSERT command through mysql to add twenty or so seconds onto the NOW() function?

View Replies !
Mysql Killing The Connection After X Seconds
I'm running mysql 4.0.20a on Windows XP Pro. I have a java web
application that connects to the database for storing persistent java
classes.

I am running into a problem when I leave my application running
overnight... I try to log in to my page in the morning and it gives
me a JDBC Exception. If I restart the web server (not the mysql
server) and then try to log in to my app runs fine.

In trying to troubleshoot I've used the mysql control center to show
the processes of the mysql server and it shows that my web app doesn't
really disconnect after running a query, it just sleeps.

Does mysql kill a connection if it has been sleeping for a long time?
How do I change this? How do I find out how many seconds of sleeping
before mysql kills the connection?

View Replies !
Difference Between Two Dates Including Seconds
1) I have mySQL 3.23 installed. I have a record with two date/times fields in YYYY-MM-DD HH:MM:SS format. How do I find the difference between those two date/times? (I would also like to know it with seconds left off.)

2) Let's say I have two records each with a date/time field in YYYY-MM-DD HH:MM:SS format. How do I find the difference in date/times when each field is in a different record?

View Replies !
3 Seconds To Run A Select That Returns Empty Set?
I have recently created a very simple table with 2 VARCHAR fields. I have then created a quick php script to loop through some inserts (inserted 600000 rows) and then deleted all the rows by doing "delete from Table where field1="abc" which should delete all rows. I then did a select * from Table and the query took 3 seconds! The return result set is empty!

Later I found out that if I do a delete * from Table, without a where clause. And then after tat do a select * from Table, it will take 0.0 seconds. Why is this? How to fix?

View Replies !
Delete Inactive Sessions Every 60 Seconds?
I have a session table, where I stored user sessions in the database in a memory table. My question is, performance wise, would it be smarter to delete inactive sessions every 60 seconds via client http requests, or would it be wiser to select active sessions via a select that uses a where clause and searches a timestamp index column for active sessions, and then a cron job is scheduled to delete every 30 minutes.

Which of these would be the better choice? On each page request I am going to have to select the number of sessions that exist and a second query that displays the active users. So if I go with my second choice, I will have to include a WHERE clause that scans the index on both those queries. But if I am issuing a delete every 60 seconds, then I won't have to do that, but then the delete is taking place every 60 seconds on a client request.


View Replies !
DATETIME :: Total Elapsed Seconds
I need to find out the total elapsed seconds between two DATETIME fields.

View Replies !
Sql Error - Shuts Down The Website In 5 Seconds
There is a program called as D4 and it sends a huge data to the sql database and it slows down the website in the first 2-3 seconds and then in a few seconds it shuts down
the website until s/he stops using the program. We made a huge research over
the internet, but we couldn't find any solutions for this. It can shut down
any website, that's having a sql based database. I hope you can help us with
this problem. Thank you for your attention and time.

if the site admins want to get the program, they can contact us. However, they should be aware that this is a dangerous program so it shoudn't be distrubuted.

View Replies !
Avoid Duplicate Records In Within 30 Seconds
I'm working with php. I have a auction site, more or less. I want to create all-time rankings. The idea is to display where a seller ranks (all time) in the number of sales.

So for example, I'd display
John Doe All Time Sales Ranking: #138

I'm not exactly sure how to go about this.

$query = "SELECT count(*) as counter, SellerName FROM sales GROUP BY Sellername ORDER BY counter DESC";

This query would give me the data to list all of the Sellers in desc order by the number of sales.

In php, I could probably count until the Sellername was equal to $Sellername (already defined in their profile page), but I was hoping there would be a way to do this entirely in MySQL.


View Replies !
Every 30 Seconds -- Reconnecting After A Failed Master Event Read
Every 30 seconds -- Reconnecting after a failed master event read ....

View Replies !
Converting A TIME Field Into Seconds : Error Message
CREATE TABLE `m010` (`date` date NOT NULL, `hour` time NOT NULL, `duration` time default NULL, `cs` int(11) default NULL, `id` bigint(20) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC

the field 'duration' is in TIME format (thus 00:00:00) .. I want to convert it in seconds.

I've read that I can do something like this:

mysql> select duration, TIME_TO_SEC (m010.duration) AS 'ts' from m010 WHERE id = 736;

Problem is, I get this error :
ERROR 1305 (42000): FUNCTION m010.TIME_TO_SEC does not exist

View Replies !
DATETIME Difference In Years, Months, Days, Hours, Seconds
I am looking for a solution to compute a difference between two datetimes.

Example :
Select SEC_TO_TIME
(UNIX_timestamp('2009-2-2 10:1:2')-
UNIX_TIMESTAMP('2009-2-1 10:00:00'))

Returns 24:01:02

There is no SEC_TO_DATE nor SEC_TO_DATETIME
How could have a result like 1day 1minute 2seconds ?

View Replies !
MySQL 4.0.18 On Dual AMD64 Opteron Causing Thread Zombie Even When Timeout Is Set To 60 Seconds
We have a problem with Dual AMD64 Opteron/MySQL 4.0.18/Mandrake 10
for a very high volume site. We are evaluating the performance on our
new server AMD64 and it seems it's slow compared to Dual Xeon/MySQL
4.0.15/RedHat8 and Dual Xeon/MySQL 4.0.18/Mandrake 10.

And it seems there are zombie threads. 570 threads in 1 hour and we
didn't even use JDBC connection pooling at all. These threads are
supposed to be gone within 60 seconds, since we set that option in
mysqld. Note that we run many SELECT queries (can be up to 150
queries/seconds), but the system does not indicate any slow query:
it's 0!

Our configuration is Apache 2.0.48 + Tomcat 5.0.27 + MySQL 4.0.18 with
MySQL connector/J 3.0.14 (latest stable). The Redhat 8 runs on Apache
2 + Tomcat 4.0 + MySQL 4.0.15. The old Redhat 8 on Xeon was fine. We
have another machine running Mandrake 10 on Xeon and they were fine
under the same load.

I have set the wait_timeout to 60 seconds, and it appears to be fine
within 10 minutes, all the threads that are in "sleep" mode
disappeared after 60 seconds. After a few minutes though, it's back
like it was before.

Is this Mandrake problem? MySQL problem? I read in here than Mandrake
win hands down on AMD64 compared to FreeBSD. Code:

View Replies !
Maximum Execution Time Of 300 Seconds Exceeded (was "MYSQL Error")
I have a huge database 400mb+ in size which i have exported into a .sql file. I tried to run this export script into a new database and it runs fine until three quarters into the scripts execution and the following error appears:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<br / >
<b>Fatal error</b>: Maximum execution time of 300 seconds exceeded in <b' at li ne 1
I believe this error may relate to "delayed_insert_timeout = 300". How do I increase this limit in mysql - maybe it may solve the problem but then again it may not .

Any advice is most gratefully appreciated - As you can imagine if the script runs fine for 3/4 of it and then an error appears, stating the error is on line 1, it will take me days to go through the whole script (hundreds of thousands of rows) to find the error as I assume the error does not reside on line 1 as this line would have been executed.

I am running the script on mysql 5, and via source /path/****.sql on linux.

View Replies !
Slow Loading Times
It takes more than 30 seconds to load the phpmyadmin page. On a localhost server.
It says
Fatal error: Maximum execution time of 30 seconds exceeded in c:appservwwwphpmyadminlibrariesmysql_wrappers.lib.php on line 101

This sometimes also happens when loading my local website that uses MySQL.
I've tried reinstalling, but it doesnt help.

View Replies !
Multiple Table Calls And Slow Loading Times... Joins?
just recently started using MySql and I think I've got most of the basics down - everything WORKS just not well. Essentially, I'm making an image gallery and the search/landing pages have thumbnails, pretty straightforward. The thumbnails are rollover slideshows of the images in the gallery so for each thumbnail preview there are a varying amount of actual thumbnail images that are loaded. The table structure is to this effect:

gallery table:
gallery_id, gallery_views, gallery_rating etc etc

thumbnails table:
gallery_id, thumbnail_link

So i may have an entry as such:
gallery_id = 21, gallery_views = 300, gallery_rating = 60

With several thumbnail entries:
gallery_id = 21, thumbnail_link = url/image1.png
gallery_id = 21, thumbnail_link = url/image2.png
gallery_id = 21, thumbnail_link = url/image3.png

What I have been doing thus far, say for the index page I grab the top 30 by views, is something like "SELECT * FROM galleries ORDER BY views DESC LIMIT 30" and then after bringing that into PHP in my while statement on each iteration I make a separate call that is like "SELECT thumbnail_link FROM thumbnails WHERE gallery_id = '$gallery_id'" and then output all the thumbnails for the rollovers. So let's say then for example that I want to show the top 30 by views, as well as the top 30 by user rating. At that point I'm making two calls to the galleries table, which arbitrarily we'll say contains 50,000 entries, but I'm also making 60 individual calls to the thumbnails table, which contains in some cases 20 or 30 thumbnail links per gallery and contains upwards of a million rows. Obviously my loading times are much higher than I would like them to be and I can't imagine this is the optimal way of making these calls. It seems like a fairly elementary concept but I can't seem to find something that works.

View Replies !
Dump File Times Out?
I have a huge Access database (about 50,000) records. I use Access dumb to create a sql file which I can them go into phpmyadmin and import the records. Well, after a while the process times out. Is there a way I can import large amount of data into MYSQL without timing out?

Also the access database that I convert over gets updated every week. I don't know which records get updated or added. Also the app I am using only works with Access so I can not completely convert over. Is there a way I can update the MYSQL without having to import that huge file again. Maybe something that will not override the records that are same just change the modifed ones and add the new records.

View Replies !
Fractions
This was originally an osCommerce question, but it is a php/mysql thing...
In the database we have fractions such as 1/4, 1/2 and 3/4. The descriptions have been copy and pasted from Word and therefore are they are in the database as ¼, ½, or ¾.
When they display on the page, however, they show as "S", "s", and "j".

View Replies !
"use Database" And Slow Log File
I have an application, which normally looks at two InnoDB databases:

1) db1 with approx 100 tables for usual queries
and
2) db2 with 2 tables for registration of visitors (cake_session).

naturally, queries appear independently and

there are a lot of queries in a slow log file after commands

use db1

and

use db2.

Need the commmand "USE" much time?

How can I reduce this time?

Is it usefull, if I make "USE" only for db1
and access the table cake_session like INSERT INTO db2.cake_session ...?

View Replies !
Appear 2 Times
i'm having this problem finding out the right sql query.
i have two tables A & B
the userid in table A appears as FK in table B
i need to list userid that appear 2 times or less in table B which has a where clause column3='Yes'

how do i go about it>?

View Replies !
Comparing Times
I'm creating a voting system, and want to prevent people from cheating. Therefore I'm logging their IP, and the time they voted, and what I'm planning to do is have a script which will delete any records which have been in the database for say 24 hours.

To get the length of time I was gonne use:

HOUR(TIMEDIFF(NOW(),time))

View Replies !
Number Of Times
I have a query that grabs 500 rows from 1 field within 1 table.

In this table. Each user will have 500 rows associated to them from within that table. So if there are 2 users then there will be 1000 rows. Each time 1 user executes the query, it grabs their 500 rows. If 2 users execute the query simultaneously, then this means that there are 1000 rows, all of which will be selected; 500 by one user and 500 by the other. If 3 users access the table simultaneously, then there are 1500 rows and so on. My question is how many users can execute this query simultaneously before we see performance loss?

View Replies !
Records Between Two Times
I have a table for a restaurant database with two fields open_time and close_time in TIME format. I want to be able to select all records that fall between open_time (when the restaurant opens) and close_time (when the restaurant closes).

I have this query:
Quote: Select hours_id from hours where curtime() between 'open_time' AND 'close_time';

It partially works, but its not working if the close_time is after midnight (i.e 1am = 01:00:00 in database). I can't figure out the issue with the difference between AM and PM.

View Replies !
One To Many Multiple Times
I have a 'links directory' database that currently contains 4 tables: category, subcategory, region and links. My links table contains company names and, among others, three fields catID, subcatID and regID. Each of these are related to primary keys in the other three tables, category (catID), subcategory (subcatID) and region (regID).

My issue is that the records in the links table can be in multiple regions, multiple subcategories and multiple categories, but the way I have it designed, each record in links can only be associated with a single catID, subcatID and regID.

Currently the only workaround I can think of it to have duplicate entries in the links table for a single company, but with every variation of catID, subcatID and regID. This will result in a very large table, but I cannot currently think of any better idea.

View Replies !
Dates And Times.
You can't have two timestamp columns in a database both with the default now().
- why I would want to is not the issue.

You can't use the data and time functions, such as CURRDATE()/CURRTIME() provided by MySQL as defaults for date/time type columns.

Is there a way to use something like 'select currtime();' as the default for a column?

so my question is, how do I use ANYTHING other than one timestamp with the default value of now() for date/time defaults in MySQL.

View Replies !
Run-times On SQL Commands
Does anyone know where I could find explanations/descriptions of runtimes on sql commands like select and functions like max(). In other words if these are linear functions/commands or log based?

View Replies !
Dates And Times
I have a field in a DB called "customerJobDate" which is configured to store full dates (ODBC dates) e.g. "2006-03-06 08:30:00". Now this does work i can update insert and delete the records perfectly, But if i query the DB asking for all dates that match 2006-03-06 regardless of the time (Date only) then the result returns 0 rows unless any of the dates in the column have 00:00:00 as the time.

This works: 2006-03-06 00:00:00
This does not work 2006-03-06 08:30:00

I hope someone can help me as I am finishing this app and this is the only thing holding me back.

View Replies !
Upload Times
I need to upload 2 star catalogues to the mysql database. the first time i tried this i filled up the HD in 2 Days, my instructor mentioned that journalling was taking up most of the space and decided to remove-it.

now, with journalling turned off, i have started re-uploading the catalogues, but have noticed a significant decrease in "write" speed.

my question is, does journalling speed up writing data into mysql tables? i have roughly 180GB of data to upload, and it took me 4 days to upload 3GB's when last time it took me this time to upload 100GB.

View Replies !
About Dates And Times
I have form with drop down boxes, where folks enter dates and times, I have used implode and explode to format the dates, now I want to write those dates to mysql, I know mysql has its own date and time functions, is there a way to convert my php formatted dates and times into something that mysql will recognize and store as a time and date or does php have a function that will convert it and then allow it to be stored in date/time format in the database?

View Replies !
Ordering Times
i have some vlaues in a database, they are 12 hour times, how would i go about sorting it so 12 comes before 1, as it is its going 1 2 3 4.... 12 etc etc, do i have to use a 24 hour time? then from there function it to show 12 hour when displayed

View Replies !
Export Records Times Out
I try to export all records from my db about once a week. I use phpmyadmin and select all tables structure and data and export as file. Well the problem now is it always times out when I do this. The db only contains about 18 tables and maybe 20,000 lines of data. The tables average about 12 fields each. So now I'm exporting a few tables at a time. Is there something I can do to change this?

View Replies !
Joining Mutiple Times
I have the following situation and I can't figure out what method to use.

I have a table with items, for these items I want to know which user inserts a row and I want to know who updates a row. In the table I store both user-ids.

The user information is stored in an other table.

How can I link both user names to the one row in the items table?

View Replies !
Left Join 2 Times
SELECT f.id as id, f.forum_name as forum, f.forum_desc as description,
count(forum_id) as threads, u.name as mod
FROM forum_forum AS f
LEFT JOIN forum_posts AS p
ON f.id = p.forum_id
AND p.topic_id=0
LEFT JOIN forum_users AS u
ON f.forum_moderator = u.id
GROUP BY f.id

Output: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod FROM forum_forum AS f LEFT JOIN forum_posts AS

Does this query contain any syntax errors? Can mysql perform left join 2 times?

View Replies !
Large Query Times
SELECT distinct column1 FROM table1, table2 WHERE column1 <> column2 ....

View Replies !
Can't Connect At Peek Times
Can't connect to local MySQL server through socket '/tmp/mysql.sock'

error raise when website peek time, current using 3rd party abstract layer, i have checked mysql_pconnect is not in using. anyone know what might cuase this error?

mysqlId setup:
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 1M
read_buffer_size = 2M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 32M
max_connections=10000

View Replies !
Call To Database Times Out
using ZenCart 1.3.7, and when it calls to the database after clicking on "go to checkout" it hangs and then returns the following error message:

I get this message after clicking on "go to checkout"
2013 Lost connection to MySQL server during query in:

[select sum(tax_rate) as tax_rate from (tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) ) where (za.zone_country_id is null or za.zone_country_id = 0 or za.zone_country_id = '223') and (za.zone_id is null or za.zone_id = 0 or za.zone_id = '12') and tr.tax_class_id = '1' group by tr.tax_priority]
2006 MySQL server has gone away in:

[select count(*) as total from sessions where sesskey = 'd60f1f220b761a5a176738c1a65de4b2']

Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0

I've checked with my host, and they are able to do a php call to the database just fine.

View Replies !
Listing Queries And Times
how can I list the queries and how long they each take?

I've done it before but forgot how;

Currently I've got the TOTAL query time on each page but I'd like a more advanced breakdown.

View Replies !
Struggling With Dates And Times!
I'm using MySQL 3.23 - I know it's old but it comes as default on Linux distribs and I just want something consistent between home, my ISP and work.

I want to work out the time difference between two entries on my database (I'm using PostNuke and have two posts which are stored as integers, ie unix times). I can see that there is now a datediff() and timediff() function but they don't work hence why I mentioned the version I'm using.

Can anyone tell me how to get the difference between two dates - I am assuming I subtract one from the other but don't know how to convert the result into something useful (like days and hours etc) because I'm not sure what the unix time is made up of.

I guess an easier version of that lot is : is a unix time just a second count?

View Replies !
Subtract Two Event Times
I am trying to formulate a complex query to get some good info straight from SQL, rather than post-processing in XL.

I have a table as follows:
EventID Integer (key)
ActionID Integer, 1 = event on, 2 = event off
dtStamp Date

I want to get the duration of each Event.

I.e. I need, for each Event:
dtStamp(actionID = 2) - dtStamp(actionID = 1)

I was going to try:

>create view EventOnTime as select EventID, dtStamp as EventOnDtStamp from EventLog where ActionID = 1;

>create view EventOffTime as select EventID, dtStamp as EventOffDtStamp from EventLog where ActionID = 2;

>select eventOnTime.EventID, eventOnTime.EventOnDtStamp - eventOffTime.EventOffDtStamp as EventDuration where eventOnTime.EventID = eventOffTime.EventID;

... but I can't create views with this version of SQL (server version: 4.0.20-standard-log)

View Replies !
Measuring Query Times
I have read a few posts here and see that some people have questions regarding the length of time it can take to perfrom their queries.

I would be quite happy reaching that stage because at least I would know how long mine take. :|

How can the time delay be forced to output? Using MySQL 5.0.

View Replies !
Adding 1 Year To All Times
suppose that

dbX -> tableX

id columnX
1 1190815874
2 1192975748
3 1196695027
4 1196796789

how can i add 1 year all value where year is 2007 ?

my sql do not run

UPDATE `tablex` SET `columnx` = DATE_ADD(`columnx`, INTERVAL 1 YEAR)
WHERE DATE_FORMAT(FROM_UNIXTIME(`columnx`),'%X')) = 2007;

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved