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.





How To Check Performance?


I have a web application which uses MySQL and I wanted to check out the performance of the database.

I have been trying to use JMeter to test the performance of it but I was wondering if there is anything MySQL specific which can give me statistics on performance etc.




View Complete Forum Thread with Replies

Related Forum Messages:
Performance :: Check Status
I have problems with mysql-performance. When I check "Status", there is written: 23% of all questions are "change db". What does it mean? Select Task are only 13%. Could this be the reason of performance problems?

View Replies !
How To Check For Date/time Ranges Within Record (check For Schedule Conflicts)
You want to check scheduling conflicts and you have a record like:

appointments(table):
apptID
beginningDate
endingDate
beginningTime
endingTime

It's easy enough to check if a time is within that record. Say you want to
check if 8:00am to 10:00am is available, you would use this:

SELECT apptID
FROM appointments
WHERE (beginningDate = '2006-01-19' OR endingDate = '2006-01-19')
AND ('08:00:00' BETWEEN beginningTime AND endingTime
OR '10:00:00' BETWEEN beginningTime AND endingTime)

BUT, what if you have an all-day appointment (8:00am to 5:00pm) and there
exists an appointment already scheduled from 10:00am to 11:00am. The above
query would not find it.

Another question is what if the appointment is more than two days. Say, it's
from Monday - Wednesday from 8am to 5pm. The above query would not
successfully catch it if you wanted to schedule an appointment on Tuesday.

(I might be able to generate a date range using PHP, don't know if that's
the best way)

View Replies !
Large Table Performance Problem With MYSQL Performance
I am doing some benchmarking of an application using MYSQL under Windows and I confused about the results.

Environment
Emachine 6417 with amd3200+ 64 bit processor 3.3GB ram

mysql 4.1 with odbc 3.51 MYISAM
windows 2003 server std edition
date, account and invoice number are indexed
Database size 18 million rows

I am querying (selecting) columns of a date and an account

our tester program that opens a socket to the Mysql database and does a select for the above n times
each time the date and the account is randomized to minimize hits on records closeby.
This program will perform over 1000 queries per second.
At the end, the Mysql socket will be closed
Even when the socket is closed each time, I still get 400 queries per second.

When I enter a similar query manually a web interface, I get about 3-9 second response time. This program opens/closes a socket for each query when using EMS I get similar 9 second results.

Does anyone have any suggestions Also in production, this table will be accesse for both read and write will I have problems. My testing showed that Innodb is much slower.

View Replies !
Check IP Against Last Day
I have a database with the following fields:

--------------------------
| id | ipaddress | time |
--------------------------

On each request I log the users IP, but before I let them enter, I want to check their IP against the database.

If their IP has been used more than 300 times (300 requests) in the last day then I want to BAN that IP. I have another table with which holds banned IP numbers. It has an ipaddress field and a timeOfBan field.

The bit which I'm stuck on is how to check the users IP against all IPs used in the last 24 hours and produce a number of how many times that IP has reqeusted... And if it's more than 300 than I ban them.

View Replies !
CHECK Syntax
I have a table as follows:

CREATE TABLE country
(
codeCHAR(2)NOT NULL,
...
...

CHECK (CHAR_LENGTH(code) == 2)
);

The entry for 'code' MUST be two characters long. Although CHECK is not
yet implemented by mySQL, is the above syntax correct?

Secondly, the entry for 'code' MUST not contain any numbers. What is
the syntax to check for that?

Currently I am doing the checking before inserting the data but would
like to implement it in the database too.

View Replies !
Numeric Check
I am looking for some function that tests if a value is numeric. I could not
find a function for this.

At the moment I am using "WHERE CONV(myfield,10,10)!=0" but I suppose there
must be a better way.

View Replies !
Mysql: Check
Is there any possibility to check existing of autoextend option
for InnoDB ?
I mean by any sql command and not by searching in my.ini file ?

View Replies !
Performing A Check
I have a table called customer with a field called dateAtAddress. I want to perfrom a check so that when a new record is created the dateAtAddress must be in the past. I have tried the following code when creating the table

dateAtAddress date,
CHECK
dateAtAddress <= DATE_SUB(CURRENT_DATE, INTERVAL 0 DAY);

But it still seems to be letting datesin the future be entered in as valid data in the field.

View Replies !
Check If Linked
I am trying to return all columns from table1 plus another column with values of true/false (or 1/0, etc) whether it is linked to table2.

For instance, the following table1 and table1x2: ....

View Replies !
Should I Check For ID Before Inserting?
On an app I'm developing, I'm integrating Facebook Connect so people can use that instead of creating an account. I store the users facebook id as a primary key in my database.

When the user logs in, I save their information in case they use other options of my site.

Should I check and see if they are already inserted into the database? The id is unique to the facebook user, so it wont be a duplicate, but I dont know if I should just leave it as is and save one less query on the site.

View Replies !
Syntax Check
Code:

SELECT (((b.close - a.close) / a.close) * 100) FROM `AAH` a, `AAH` b WHERE b.date = '2007-01-03' AND a.date = '2007-01-02'



and said error:

Quote: 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 'b.close - a.close) / a.close) * 100) FROM `AAH` a, `AAH` b WHERE b.date = '2007-' at line 1
it is supposed to retrieve and calculate the percent change for the closing prices of a symbol on a particular stock market. Not sure what the exact error is.

View Replies !
Duplicate Check
I have a table with two columns, T1(id,info). I'd like to add some data from another table which also has two tables T2(id,info).

I have to add data from T2 into T1, but i have to check if the data already exists. Until now i did like this : select info from T1 where info in (select info from T2) but it fails if i have more that 5.000 records. Is there another way to do this ?

View Replies !
Check Constraint
does mySQL provide Check Constraint?

I try this :
alter table city add check(id>0);

It runs without error but when i tried to insert a city name with id = 0 the query runs ok. the check constraint fail to work.

oh ya, what is the syntax to see all the check constraint on a table?

View Replies !
CHECK Command
Could I use the check command to see if a certain identifier will never exceed a default value when data is put into the table.

capacity INTEGER NOT NULL DEFAULT 10,
CHECK(capacity<=10)

View Replies !
SQL To Check For A File?
I have a field in my DB that was pre-populated with a filename for each record. This filename is a picture that then shows up on the website. Problem is not all the pictuers are up yet so they wonderful red X shows instead for ones with no pictures.

We do have it setup so that if there is no picture file specified, it just shows a default "No Image" wording.

So, since all the records already have a filename in them, is there any way with SQL to have it go through the records, check what's in the image field, then see if that file exists or not? THen if it does, great, if it doesn't it would delete the value from the field?

View Replies !
Check For Existing Row ?
How do I determine if a row already exists ?

// see if a row has id=100

$id=100;
$query="SELECT * FROM mytable WHERE id=$id";
$result=mysql_query($query);

...what do I check now ?

View Replies !
Check 366 Day Expiration
Needing to filter on a datetime col Mplan.Start having runtimes of 366 days:

roughly:
SELECT *
FROM Plan
WHERE (CURRENT_DATE () <= Plan.Start + 366 days)

should dates be formatted 1st?

...WHERE DATE_FORMAT(Plan.Start ,'%Y%m%d') >= DATE_FORMAT(CURRENT_DATE(),'%Y%m%d' + ?)

problem with the following is that all future dates are included, as mysql manual states (which can't be included in this application):

...WHERE CURDATE() <=DATE_ADD(Start,INTERVAL 366 DAY)

View Replies !
Check Query Please
This is giving me an mysql error. Why?

DELETE FROM subscribers,list_subscribers WHERE subscribers.id = list_subscribers.ls_sub_id AND list_subscribers.ls_list_id = 1

View Replies !
Check If A Field Is In A Given Set
How do you check if a field is in a given set? I thought it was like this:

mysql_query("UPDATE Topics SET locked='yes' WHERE account='$account' AND topicid IN [".implode(",",$_POST['locked'])."]");

View Replies !
Check Which Server Running
i'd like to know how control which server is actually running between mysqld and mysqld-max.

View Replies !
Duplicate Records Check
Could any one advise what SQL statement I would need to use, to check a
table for any duplicate records e.g that contain the same data within a
field. Note that I haven't got the field as a unqiue field.

View Replies !
Check For Duplicate Databases
I have a program that I am writing in PHP/MySQL. I have made some upgrades
to the database and like an idiot, forgot to write down the changes or to
make the changes in several other databases for the other clients that are
using the program also. What I am trying to do is to have a program,
(preferably in PHP) that will look at the structure of the main database
that I changed, then it will check the other databases to make sure that
the structure is identical and if not, it will change them to make them
identical. Is there a program already out there that would do this?

View Replies !
CHECK CONSTRAINT On A Column
I am not familiar with MySQL, but we are currently looking at it. Currently our software product supports Oracle, DB2, and we want to see what it takes to also include MySQL.

One stumbling block we have come across is that it seems that the CREATE TABLE command does not support the CHECK CONSTRAINT on a column. I know there is such a thing as the ENUM column in MySQL, but what if we want to set the constraint between two values.

Example:

CREATE TABLE TMPTABLE
COLONE CHAR(10),
COLTWO INT CHECK (COLTWO BETWEEN 1 AND 200)....

Is there such a thing in MySQL.

View Replies !
Check If Field Already Exist
How can I check if a field already exist in a table? If it doesn't exist I want
to add it with ALTER TABLE ADD...

View Replies !
How To Check If A Table Is Empty?
I want to check if a table is empty or not?

In my table (i.e test) have no records and id is a primary key as well as auto increment column.

i have using to find this "select count(id) from test"

It gives 1 .

ALso using others query but only get answer 1

View Replies !
Check If Table Is Exist Or Not
May this question exist....But i confused...I want to check whether the table is exist or not ....

Like i run a project , on that project i create a mysql tables while run time.... on that i want to chech a table is exist or not...


if employee table is exist ....

exit;

else

create table employee

View Replies !
Bitwise Check Or Second Table?
IE:
Brand 1 = 1
Brand 2 = 2
Brand 3 = 4
Brand 4 = 8
Brand 1 + 4 = 9
[...]

Then I would do... "WHERE brand_id & submitted_id > 0".

Or just create a second table such as

brand_x_store
--------------
store_id
brand_id

where brand_id would be:
brand 1 = 1
brand 2 = 2
[...]

View Replies !
Check If Record Exists
is there a quick and easy way to check if a record exists?
At teh moment I do a select statement then count the rows retrieved, if its greater than 0 I know a record exists. Anyone know of a simpler way or is this it?

View Replies !
Check If Table Exsists
Am creating an install.php page to create the tables for a database. After running the code I want to make sure the tables were created, how do you check is a table exsists in mysql?

View Replies !
Check Existing Values
In my web site I'm using PHP, & MySQL.
There its needed if a user is trying to be registerd using a existing user ID.
That is I think, it should check such a value existing and if exists it must display "Existing User ID".

View Replies !
Check If A Table Exists
is there any way to check if a table exists in mysql? i am using a graph program in vb, but if the table it is trying to graph doesnt exist it breaks down! i need some sort of check so as the offending table will not be added to the query if it doesnt exist?

View Replies !
Check Existience Of Records
I'm trying to find out if something exists in table A *or* table b,

SELECT tableA.user, tableB.user FROM tableA, tableB WHERE tableA.user = 'someuser' OR tableB.user = 'someuser'

But that returns an empty results, even though I know that the user exists in tableA.

View Replies !
Using Trigger To Check Duplicate
I am currently using MySQL 5.0 Query Browser and i would like to create trigger within the browser. Here's my code

Code:

CREATE TRIGGER check_OrderID BEFORE INSERT ON DELIVERY
FOR EACH ROW
BEGIN
IF(orderID!=NEW.OrderID)
THEN
INSERT INTO DELIVERY(DeliveryID,OrderID,DriverID,DeliveryVID)
VALUES(NEW.DeliveryID,NEW.OrderID,NEW.DriverID,NEW.DeliveryVID);
END;

Actually I want to check if the OrderID to be inserted is already in the Delivery table, then that insertion is to ba aborted, if not, it will just continue with the insertion.

View Replies !
Check Username Case
I have a query about checking the case of a username.

If i have a username TEST, if i enter in TEST or test the result from sql is true. I can check it in the program itself but is there a way to do it in SQL.

View Replies !
Check For A Trigger Existence
how i can check to see whether a trigger exists and if it exists then delete it ?
can some one provide an example sql code for this ?

View Replies !
How To Check For Errors In MySQL?
How do you check for errors in the MySQL database? The MySQL database on my site works, but frequently causes the server to crash.

I wanted to know what errors it has. How can I check it? Is their a MySQL validator like their is an RSS Validator or a Java Validator?

View Replies !
How To Check If A DB AND Table Exists
I am trying to do is create some code which will allow me to check if a table of a certain name exists in a database. If the table DOES exist, then I want the code to then insert values into the table. If the table does not exist, then the table should be created, and then the values entered.

I am trying to make it as automated as possible, with a minimum of user involvement as possible.

here is my code so far;

<?php

$username=1;
$punishment=2;
$offence=3;
mysql_connect(localhost, root, panda);

if exists(SELECT * FROM information_schema.tables WHERE table_name = 'naughtylist')

{
insert into naughtylist (username, offence, punishment) VALUES ('$username','$offence','$punishment');
}

[else

begin {

CREATE TABLE `naughtylist`.`watchlist` (
`username` VARCHAR(16) NOT NULL,
`offence` TEXT NOT NULL,
`punishment` TEXT NOT NULL,
PRIMARY KEY (`username`)
)
ENGINE = InnoDB;

insert into naughtylist (username, offence, punishment) VALUES ('$username', '$offence', '$punishment')

]
}
end

?>

View Replies !
Check To See If Database Exists
i'd like to do a quick check to see if a Database exists. i know i can do this:

DROP DATABASE IF EXISTS `databaseName`

but how do i return just whether or not it exists?

View Replies !
Query To Check Space Used
SELECT TABLE_NAME as 'Name table', TABLE_ROWS as 'NB lines',ROW_FORMAT as 'Format Table' . , Max_data_length as 'Max_Data_Length', Data_length as 'Data_Length'....

View Replies !
How To Check If SQL Is Configured Correctly
I am a newbie to mySQL and need help setting it up on my Mac. I downloaded mySQL and have it running, but when I have a PHP action file that calls to my mySQL databases, I am not getting any response. How do I make sure that mySQL is communicating with PHP?

View Replies !
Check Table For An Entry?
I'm currently working on some rudamentry administration, namely an IP ban list. I want to make it so that if the user trys to ban an IP that is already in the list, the entry will be removed instead. what would be the best way to go about this?

View Replies !
Check If A Table Has Been Updated
I'd like to find a way to check if any modifications has been made to a table. I'm using mysql 4.1. I'm trying to find the least resource intensive method of doing this.

View Replies !
Implementing The CHECK Clause`
I am working with mySQL version 4.1.14-max on an Apple Mac. I have been tring to finish up a homework assignment to create the following domain:

CREATE DOMAIN Id INTEGER CHECK ( VALUE > 999 AND VALUE < 99999);

and can't seem to get it to work. I also try addeding the CHECK clause directly into the table, which worked. But, the table is not enforcong the range requierments. After searching the web, I found that mySQL will parse and ignore the CHECK clause when used with CREATE TABLE. So, I have no idea how to restricted the range on the Id attribute.

View Replies !
Programmatically Check Values
I'm completely new within MySQL. I've just used Microsoft Access. Right now, I have to develop a database to store a lot of data. I've heard that it is possible to consult these data with the internet explorer programming a webpage with PHP. Is there some example about it? Is this PHP free to download? Where can I get it?

View Replies !
How To Check Permissions On Tables
I'm developing in Groupware (a php / template-based tool for making office-like applications). It creates mysql tables as it goes. I am not seeing those tables being created, and I'd like to determine if it's a permissions problem.

I'm in a shell on a Linux system, but I'm very unfamiliar with Linux command line.
So far, I can logon as root, use database, show tables; (this is how I know my tables aren't there.)

So, what can I do to ensure that my permissions are set up correctly? When I was setting permissions in the Linux directories, I used 'chown'.

View Replies !
How Do I Check For Missing Records?
I have nearly 10,000 records in my database so it would be impossible to check to see if all of the records are in the database if I checked by hand. I have an integer field in my db called Lnum which I created using excel. The purpose of the Lnum field was to give me a reference and numbering field in the spreadsheet work.

I carried the Lnum field over into the db. The Lnum field has integers numbered for the most part sequentially. A few numbers are repeated. What I want to check for is whether there are any missing records in the database by checking to make sure there are no numerical gaps between Lnum = 1 and Lnum = 99,500.

If there is a numerical gap in the Lnum sequencing, this means I have a missing record or records. Is there a way to use the Lnum field to find missing records, possibly by adding an incrementally numbered field?

View Replies !
How To Check Mysql's Logfile?
Is the file ib_logfile1 in the data directory mysql's log file? I used mysqlbinlog but it says it's not a binary file.

View Replies !
Check And Alert If Not Unique
I have some columns in my database that are set to unique.

How would I structure my query so it can recognize and tell the user instead of just not storing the data?

I wasn't sure to post this in mysql or php. sorry if it should have been in php.

View Replies !
Check If An Entry Exists
I have a table which records information on ratings that each user has given each movie, it looks a little like this:

Table = USER_VOTES

USER_ID MOVIE_ID VOTE
1 2 5
2 3 5
3 4 5
3 5 5
4 3 5

I an using a simple SELECT command to find if a user has already voted, ie. if a row already exists with their USER_ID and MOVIE_ID. I am having a little trouble with this SELECT statement and wonder if there is a better way of doing this simple check. My code looks like this:

$sql = "SELECT vote FROM user_votes WHERE movie_id='$id' && user_id='$usrID'";
if ($result = mysql_query($sql, $db)) {
//if vote already exists display error
$error = "You have already voted for this moive
(your rating was ".mysql_result($result,0,"vote").").";
} else {
//if no vote exists process vote...
}

If a user has not voted before I get an error like this:
Unable to jump to row 0 on MySQL result index 2

To me it appears that mysql_query() does not return false when no results are found. Is there a command which does check results and return false or is there a much easier way to check, perhaps there could be some checking code in the actual SQL query?

View Replies !
MySQL Error For CHECK?
I am getting an error with this query:

SELECT last_name,total,paid_on,check,value,first_name,status,report_by_agents.id FROM report_by_agents LEFT JOIN agents ON agents.id = report_by_agents.agent_id LEFT JOIN transactions ON transactions.report_id = report_by_agents.id WHERE date_format(report_by_agents.stamp, '%M %Y') = '' && suspended>NOW() AND ( last_name LIKE '%' ) ORDER BY last_name ASC LIMIT 0,50

The error is:
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 'CHECK , value, first_name,
STATUS , report_by_agents.id
FROM r

Is CHECK a reserved keyword? When I put a single quotes for check, it works fine. But I am not sure if it means the same thing.

View Replies !
Check Before Insert Query
if (!empty($determin))
{
//do something when its not empty

$query = "SELECT * FROM `JS` WHERE `wrdnprc` LIKE '$mkrs' LIMIT 1";
$good_query=mysql_query($query) or die(mysql_error());

if (mysql_num_rows($good_query) == 1 )

{
echo "record found #2<br>";
}
else
{
$query = "INSERT INTO `JS` ( `id` , `wrdprc` , `wrdnprc` , `pgld` ) VALUES ('', '$mkrs', '2', '0') ";
$query=mysql_query($query) or die(mysql_error());

echo "adding record #2<br>"; }
}
else
{
//its empty... lets whine about it
echo "no <br>";
}

most of the work is being done, which is good thing BUT the query will INSERT regardless of the if good_query statement.

View Replies !
I Want To Check That A String Is In A Field
I want to select everything where a specific short string, is in the actual field. Eg, if I use a search string of alpine, it will be 'in' the field value Alpine Forests, so I will select the field that contains Alpine Forests.

This is my SQL so far and it doesn't work

SELECT * from packages2_tbl WHERE (INSTR(model, LCASE('Alpine'))) AND product_active = 'yes' ORDER BY model ASC"
Has anyone got any ideas?

View Replies !

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