On Feb 7, 12:19 am, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Wed, 2008-02-06 at 14:51 -0800, mcl wrote: > > I have looked through Python Database API Specification v2.0, but can > > not find any reference to the number of records processed in a select > > query. > > > I know I can get the number of records returned with cursor.rowcount, > > but I want to know the number of records processed. > > > I suppose the info is in one of the internal tables, but I can not > > find any info on that, because phpMyAdmin shows the number of rows in > > a table. > > > I suppose I could use count(*), but would that process all the > > records, which would seem a bit silly. > > > What is the best method ? > > Please define what you mean by "processed". If you simply need to know > how many rows are in a table, "select count(*) from that_table" is the > obvious solution. If the database engine is sufficiently intelligent, it > won't have to read the data in every single row to count the rows. > > If that's not what you're looking for, please feel free to be more > specific about what you need to achieve. > > -- > Carsten Haesehttp://informixdb.sourceforge.net
Thanks for all the helpful replies. If you think Count(*) is intelligent, then that is the easy answer. I will attempt to do some timings. I did mean number of rows in a table - by processed. -- http://mail.python.org/mailman/listinfo/python-list