Can I estimate the row count of a large mysql table using the disk space?
Let’s find an answer to "Can I estimate the row count of a large mysql table using the disk space?". The most accurate or helpful solution is served by Database Administrators.
There are ten answers to this question.
Best solution
Sysadmin here (not a developer by trade), so go easy please ;) I have a mysql table, on a linux server that uses innodb_file_per_table. When I try to do select count(foo) from table; It doesn't finish. I gave it a good 5 minutes before interrupting. The table.ibd file is about 43G (45176848384). Since the count() seemed like it was never going to finish, I decided to try the following to get an estimate of the row count: I dumped the first 10,000 rows of the table and imported it to a local...
Answer:
You cannot make that kind of approximation work if the InnoDB table experiences DELETE and UPDATEs....
Kevin at Database Administrators Mark as irrelevant Undo
Other solutions
Answer:
SELECT table_name, data_length FROM information_schema.tables WHERE table_schema = [your db name] ORDER...
Adam D'Angelo at Quora Mark as irrelevant Undo
Howdy, Can I ask a Cassandra data model question here about time series data and timeline query? Materialized Views or Index CF, which way is better to handle 20 single column indexes in one table? We have a book table with 20 columns, 300 million rows...
Answer:
Short answer - Use IndexCF. You will have to hit cassandra twice to get full object but thats a tradeoff...
Sarang Anajwala at Quora Mark as irrelevant Undo
I have a single InnoDB table growing about 800 MB per day with user-to-user interaction data, therefore they are small inserts all day long. Today it has ~100GB of data + indicies. One day I will run out of storage in the current architecture. Most of...
Answer:
A combination of pt-archiver and pt-online-schema-change.html might accomplish what you are looking...
Aaron Brown at Quora Mark as irrelevant Undo
I would like to charge the users of my SaaS, by the amount of disk space that their data stored on the MySQL server is taking. There is only ione database and it's a system where all the tables contain shared data belonging to all the clients and each...
Answer:
The best way may be to rearchitect your application so that data for each client is in their own tables...
Stewart Smith at Quora Mark as irrelevant Undo
Hi, Im trying to create a table in mysql using variable $signupemail as table name. Here is my code mysql_select_db("profiles",$connect); mysql_query("CREATE TABLE ".$signupemail." (FirstName VARCHAR(30), LastName VARCHAR(30...
Answer:
its been a while since i worked with php, but it looks good to me. try setting the query as a variable...
Yang at Yahoo! Answers Mark as irrelevant Undo
I was considering following approach: Create a table with new schema in the same database Replicate all write operations of old table on this table using bin logs (Note that old table is still serving live traffic) Once new table has caught up, rename...
Answer:
I think, your approach is correct but there might be some complications as mentioned here: pt-online...
Smit Hinsu at Quora Mark as irrelevant Undo
I have some code like this: $table = 'table'; $stmt = $mysqli->prepare("CREATE TABLE $table ( ... ") or die($mysqli->error); if ($stmt === FALSE) { ...show more
Answer:
Is the execute really inside the if statement as you posted it here? You have a {, but no } before ...
BFKASAW7YVN34L25NS5VPSKVTI at Yahoo! Answers Mark as irrelevant Undo
Using the 'product_id' in Table A, I would like to check if a product exists in Table B. If the product does exist, I want to replace the 'product_price' in Table B with the one from Table A. I am currently using a 'while' loop in PHP, checking each...
Answer:
For one I think your '$oldPrice = mysql_num_rows' line is going to cause you issues. You aren't counting...
xoroid@ymail.com at Yahoo! Answers Mark as irrelevant Undo
I have the following line in my plugin to remove transients from the database option table. $wpdb->query( "DELETE FROM `wp_options` WHERE `option_name` LIKE ('_transient%_feed_%')" ); However, it won't work with sites which set a prefix...
Answer:
Use the global wordpress variable $table_prefix in your query: $wpdb->query( "DELETE FROM ...
Nicholas Pickering at Quora Mark as irrelevant Undo
Related Q & A:
- How to skip columns empty in CSV file when importing into MySQL table using LOAD DATA INFILE?Best solution by Stack Overflow
- If I major in sociology can I go to graduate school for a masters in social work and how long will it take?Best solution by Yahoo! Answers
- Can I find the new address of a cousin if I have the old address?Best solution by address.com
- How can I connect my non-HD DirecTv receiver to my hdtv using an hdmi cable?Best solution by Yahoo! Answers
- How can I estimate my IELTS score?Best solution by Quora
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.