cancel
Showing results for 
Search instead for 
Did you mean: 

MySQL query to count records in table

bensewell
Champ in-the-making
Champ in-the-making
Hi,

Wanting to run a regular MySQL query through a cronjob that lists the Alfresco tables and the number of records and size of the table.  I can do this per table easy enough but don't know where to start gettnig all the tables in one query. 

I'm after something like this:

table name, no of records, table size

Has anyone done this before?  I don't want to install the GUI tools to get round it if someone else has done this before?

Thanks
3 REPLIES 3

mikeh
Star Contributor
Star Contributor
Have you tried the MySQL forums? What you're asking isn't really Alfresco specific.

Thanks,
Mike

bensewell
Champ in-the-making
Champ in-the-making
OK Thanks,  Yes I've put a post on but think i've worked it out anyway.

Thanks,

bensewell
Champ in-the-making
Champ in-the-making
For all of you who want to do this.  Here goes:

If you run this on your MySQL database prior to doing a backup then you will get the number of records backed up etc then you can see how quickly your system is growing.

select table_catalog, table schema, table_name, table_type, table_rows, update_time from information_schema.tables where table_schema='alfresco';

run this against your information_schema database and it will show you the information you require.