Skip to content

Instantly share code, notes, and snippets.

@jmelloy
Last active December 27, 2015 17:19
Show Gist options
  • Save jmelloy/7361031 to your computer and use it in GitHub Desktop.
Save jmelloy/7361031 to your computer and use it in GitHub Desktop.
select table_counts.table_name, table_rows est_rows, count, table_rows / total_rows * 100 percent,
lpad('|', least((table_rows / total_rows) * 24, 24), '-') progress
from table_counts left join information_schema.tables on (information_schema.table_name = table_counts.table_name)
where table_schema = 'al_data';
+------------------------------+------------+--------+-----------+--------------------------+
| cities | est_rows | count | percent | progress |
+------------------------------+------------+--------+-----------+--------------------------+
| cities | 29 | 22 | 131.8182 | -----------------------| |
| city_data | 5470 | 8649 | 63.2443 | --------------| |
| city_images | 7276 | 7246 | 100.4140 | -----------------------| |
| city_population_data | 109874 | 107386 | 102.3169 | -----------------------| |
| city_weather_data | 194 | 189 | 102.6455 | -----------------------| |
| months | 12 | 12 | 100.0000 | -----------------------| |
| pricedata | 21948 | 22044 | 99.5645 | -----------------------| |
| property_data | 10711 | 19002 | 56.3678 | -------------| |
| property_data_copy | 12910 | 13817 | 93.4356 | ---------------------| |
| property_images | 18485 | 16494 | 112.0711 | -----------------------| |
| property_images_old | 10028 | 10176 | 98.5456 | -----------------------| |
| property_images_supplemental | 15 | 15 | 100.0000 | -----------------------| |
| state | 792 | 50 | 1584.0000 | -----------------------| |
| wp_comments | 0 | 0 | NULL | NULL |
| wp_ratings | 0 | 0 | NULL | NULL |
| zipcodes | 26400 | 75896 | 34.7844 | -------| |
+------------------------------+------------+--------+-----------+--------------------------+
@lennax
Copy link

lennax commented Nov 7, 2013

:D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment