From 0ebc63e0a7bb6801b8d82e3d258c5a646294b5c3 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 13 Jul 2003 12:24:06 +0000 Subject: [PATCH] count number of entries in tables (one for each index) git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@89 13eb9ef6-21d5-0310-b721-a9d68796d827 --- tools/count_tables.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 tools/count_tables.sh diff --git a/tools/count_tables.sh b/tools/count_tables.sh new file mode 100755 index 0000000..7c80b5b --- /dev/null +++ b/tools/count_tables.sh @@ -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 -- 2.20.1