From 4207df80780b7d38316a3ebe9edf49475a4ee2db Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 28 Aug 2013 07:28:37 -0700 Subject: [PATCH] apply limit to all; list messages without connname too --- xwords4/relay/scripts/showinplay.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xwords4/relay/scripts/showinplay.sh b/xwords4/relay/scripts/showinplay.sh index 327f30a9a..3f17c2bc9 100755 --- a/xwords4/relay/scripts/showinplay.sh +++ b/xwords4/relay/scripts/showinplay.sh @@ -27,15 +27,16 @@ echo -n "Device (pid) count: $(pidof xwords | wc | awk '{print $2}')" echo "; relay pid[s]: $(pidof xwrelay)" echo "Row count:" $(psql -t xwgames -c "select count(*) FROM games $QUERY;") -echo "SELECT dead as d,connname,cid,room,lang as lg,clntVers as cv ,ntotal as t,nperdevice as nPerDev,nsents as snts, seeds,devids,tokens,ack "\ +echo "SELECT dead as d,connname,cid,room,lang as lg,clntVers as cv ,ntotal as t,nperdevice as nPerDev,nsents as snts, seeds,devids,tokens,ack, mtimes "\ "FROM games $QUERY ORDER BY NOT dead, connname LIMIT $LIMIT;" \ | psql xwgames echo "SELECT connname, hid, devid, count(*), sum(msglen) "\ - "FROM msgs where connname in (SELECT connname from games where not games.dead group by connname)" \ - "GROUP BY connname, hid, devid ORDER BY connname;" \ + "FROM msgs where connname in (SELECT connname from games where not games.dead group by connname) "\ + "OR devid IN (SELECT unnest(devids) from games where not games.dead) "\ + "GROUP BY connname, hid, devid ORDER BY connname LIMIT $LIMIT;" \ | psql xwgames -echo "SELECT * FROM devices WHERE id IN (select UNNEST(devids) FROM games $QUERY) ORDER BY id;" \ +echo "SELECT * FROM devices WHERE id IN (select UNNEST(devids) FROM games $QUERY) ORDER BY id LIMIT $LIMIT;" \ | psql xwgames