How many rows of data are in the entire database
Posted in 2015
Topics: General Discussion
IDS 11.50.FC7 Solaris 10 - 64 bit Is there a way to approximate how many rows of data are in an entire database? I am not so much concerned about sizes, or what kind of data is in the tables. I just need to know the total number of rows in all the tables combined. (I know...weird question) Thanks. LArry
Try,
After update statis
select Sum(nrows) from systables
or this should work too for all databases.
Regards - Lester
-----------------------------------------------------------------------------
-- Module: @(#)tab_row_count.sql 1.0 Date: 2015/07/16
-- Author: Lester Knutsen Email: lester@advancedatatools.com
-- Advanced DataTools Corporation
-- Description:
-- Tested with Informix 11.70 and Informix 12.10
-----------------------------------------------------------------------------
database sysmaster;
select
dbsname database,
-- tabname tabname,
sum(ti_nrows) num_rows
from systabnames, systabinfo
where ti_partnum = partnum
and dbsname not in ( "sysmaster", "sysuser", "sysutils", "sysadmin" )
group by 1;
On 7/16/15 3:55 PM, LARRY SORENSEN wrote:
> IDS 11.50.FC7
> Solaris 10 - 64 bit
>
> Is there a way to approximate how many rows of data are in an entire
database?
> I am not so much concerned about sizes, or what kind of data is in the
tables.
> I just need to know the total number of rows in all the tables combined. (I
> know...weird question)
>
> Thanks.
>
> LArry
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
______________________________________________________________________
Lester Knutsen lester@advancedatatools.com
Advanced DataTools Corporation Voice: 703-256-0267 x102
Visit our Web page: http://www.advancedatatools.com
______________________________________________________________________
Per database or over the entire server? For the server as a whole:' select sum(nrows) from sysmaster:sysptnhdr; For a single database: select sum(nrows) from sysmaster:systabnames as st, sysmaster:sysptnhdr as sp where st.partnum = sp.partnum and st.dbsname = 'mydatabase'; Art Art S. Kagel, President and Principal Consultant ASK Database Management www.askdbmgt.com Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Thu, Jul 16, 2015 at 3:55 PM, LARRY SORENSEN <lsorensen25@msn.com> wrote: > IDS 11.50.FC7 > Solaris 10 - 64 bit > > Is there a way to approximate how many rows of data are in an entire > database? > I am not so much concerned about sizes, or what kind of data is in the > tables. > I just need to know the total number of rows in all the tables combined. (I > know...weird question) > > Thanks. > > LArry > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --089e012953807f65ca051b03b8f4
Thank you all for your responses. Larry > To: ids@iiug.org > From: art.kagel@gmail.com > Subject: Re: How many rows of data are in the entire da.... [35479] > Date: Thu, 16 Jul 2015 16:14:41 -0400 > > Per database or over the entire server? > > For the server as a whole:' > > select sum(nrows) > from sysmaster:sysptnhdr; > > For a single database: > > select sum(nrows) > from sysmaster:systabnames as st, sysmaster:sysptnhdr as sp > where st.partnum = sp.partnum > > and st.dbsname = 'mydatabase'; > > Art > > Art S. Kagel, President and Principal Consultant > ASK Database Management > www.askdbmgt.com > > Blog: http://informix-myview.blogspot.com/ > > Disclaimer: Please keep in mind that my own opinions are my own opinions > and do not reflect on the IIUG, nor any other organization with which I am > associated either explicitly, implicitly, or by inference. Neither do > those opinions reflect those of other individuals affiliated with any > entity with which I am affiliated nor those of the entities themselves. > > On Thu, Jul 16, 2015 at 3:55 PM, LARRY SORENSEN <lsorensen25@msn.com> wrote: > > > IDS 11.50.FC7 > > Solaris 10 - 64 bit > > > > Is there a way to approximate how many rows of data are in an entire > > database? > > I am not so much concerned about sizes, or what kind of data is in the > > tables. > > I just need to know the total number of rows in all the tables combined. (I > > know...weird question) > > > > Thanks. > > > > LArry > > > > > > > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > > > --089e012953807f65ca051b03b8f4 > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. >