473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Statistics for SHOW TABLE

hi

my question is about "SHOW TABLE STATUS LIKE 'tablename'";

following is the code i am presently using

================================================== ================

$conn = mysql_connect("localhost","username","password");


$showquery = "SHOW TABLE STATUS LIKE 'tablename'";

if(!$conn)
{
echo "Unable to connect to the Database";
}

else
{
mysql_select_db("databasename", $conn);


$result = mysql_query($showquery);

while($array = mysql_fetch_array($result))
{
echo "<br><br>
Table Name : ".$array['Name']."<br />
.....................................
.....................................
When the data file was last updated. : ".$array['Update_time']."<br />
";

}
}

================================================== ================

This code works fine and i am able to display the values. following are my questions.

1.
echo "The number of allocated but unused bytes: ".$array['Data_free']; = This does not display any number at all.

so i have subtracted the value of Max_data_length with Data_length
$maxdata=$array['Max_data_length']; $datalength= $array['Data_length'];

$availabledata= $maxdata - $datalength;

echo "Data Available is = ". $availabledata;

By doing so $availabledata is not same as $maxdata - $datalength;

how to fix this.

2.
echo "The maximum length of the data file. This is the total number of bytes of data that can be stored in the table : " . $array['Max_data_length'];

displays 4294967295 which comes to 3.99 GB

Does this mean that the Entire capacity for the MySql Database that is installed on the unix server including all the
a) Tables and from all the Databases is 3.99 GB

Because i have used this SHOW TABLE STATUS LIKE 'tablename' for all the tables i have have in 3 databases that i have, in each case the value displayed for
echo $array['Max_data_length']; is 4294967295 which is 3.99 GB so i am assuming the total capacity for "MySql Database VERSION 3.23.58" that is installed on the unix server can hold a maximum of 3.99 GB of data each time data is inserted into the various tables which are in different databases

3.
echo $array['Data_length'] = The value displayed is ex= 36872 for this, does it mean that 36872 number of bytes have been consumed by a particular table at a particular time, everytime an insert statement had been executed


4.
Also i have 2 databases and each have couple of tables so i guess i will have to use the following statement 2 times

mysql_select_db("database1", $conn);
mysql_select_db("database2", $conn);

and use $result = mysql_query($showquery); equivalent to the total number of tables from both the databases

please advice.

thanks a lot.
Jan 30 '08 #1
0 1538

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Justin Lebar | last post by:
Sorry about the huge post, but I think this is the amount of information necessary for someone to help me with a good answer. I'm writing a statistical analysis program in ASP.net and MSSQL7 that...
17
by: Felix | last post by:
Dear Sql Server experts: First off, I am no sql server expert :) A few months ago I put a database into a production environment. Recently, It was brought to my attention that a particular...
3
by: Metal Dave | last post by:
Hello, A script we run against the database as part of the upgrade of our product is failing with the following message: ALTER TABLE ALTER COLUMN EncodedID failed because STATISTICS hind_61_3...
2
by: Ihug | last post by:
I have a database table with approx 3 million rows. There are 9 indexes on this table. The command: SHOW INDEX FROM TRAN; Returns results as expected with all indexes some valid "Cardinality"...
2
by: Lyn Duong | last post by:
Hi, I have a job that performs a runstats on tables in my database (db2 V8 on AIX) and the syntax is db2 runstats on table schema.tabname with distribution and detailed indexes all. when I...
4
by: serge | last post by:
I am running a query in SQL 2000 SP4, Windows 2000 Server that is not being shared with any other users or any sql connections users. The db involves a lot of tables, JOINs, LEFT JOINs, UNIONS...
0
by: Bucker | last post by:
Could someone view the following that I copied from phpMyAdmin and tell me from the statistics if are server is running OK? Does it look like we will have problems as more people hit our server?...
3
by: Otto Carl Marte | last post by:
>From the IBM db2 docs: http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/t0005308.htm it says that volatile tables (ALTER TABLE mytable VOLATILE...
0
ADezii
by: ADezii | last post by:
In last week's Tip, I showed you how to use the ISAMStats Method of the DBEngine (DAO) to return vital statistics concerning Query executions such as: Disk Reads and Writes, Cache Reads and Writes,...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.