count number of entries in tables (one for each index)
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 13 Jul 2003 12:24:06 +0000 (12:24 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 13 Jul 2003 12:24:06 +0000 (12:24 +0000)
git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@89 13eb9ef6-21d5-0310-b721-a9d68796d827

tools/count_tables.sh [new file with mode: 0755]

diff --git a/tools/count_tables.sh b/tools/count_tables.sh
new file mode 100755 (executable)
index 0000000..7c80b5b
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# count number of records in all tables
+
+db="webpac-dev"
+
+echo "records in $db, by table"
+psql $db -A -t -F : -c "\d" | cut -d: -f2 | xargs -i psql $db -A -t -F "       " -c "select count(*),'{}' from {}" | sort -nr