Re: Count(*)ing nested tables



> > Benchmark it. It will differ by RDBMS. In all likelihood using the primary
> > key in the count would probably be most efficient. Usually there is an
> > index on the primary key and the optimizer might use the index to get the
> > row count.
> > Jim
>
> Thanks Jim. I'm trying out the different approaches now. I can't
> optimize it for any specific RDBMS though as the tool needs to remain
> independent.

It looks like the performance of "select(*)" and "select(pk)" is
equivalent, at least under Oracle. "select(1)" lags quite a bit
behind, so I'll probably use it when the other fails.

Thanks,
John
http://schemaspy.sourceforge.net

.



Relevant Pages

  • Re: Updating the correct keys
    ... > Many thanks Jim for your comprehensive reply. ... >> dataset keys to sync up with the real keys in the database and how do ... >> from the database with the real primary key. ... >>> tables are transferred to the SQL database. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Updating the correct keys
    ... >> Many thanks Jim for your comprehensive reply. ... >>> Hi Geoff, ... >>> dataset keys to sync up with the real keys in the database and how do ... >>> from the database with the real primary key. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: UpdateCommand error
    ... > Looks like your table does not have a primary key defined. ... SELECT firstname, lastname from tmaster ... Jim ... Prev by Date: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Manipulate duplicate rows
    ... > I have two of the exact same rows, but I want to change one field of one of ... >A jim 20 ... always have a primary key. ... for SQL Server to distinguish one row from the other, ...
    (microsoft.public.sqlserver.mseq)
  • Re: question about query optimizer
    ... >>>go to unknowndatabase.com and click on the white paper link. ... >> Thanks Jim, but that link is broken somehow ... ... We know it isn't true of the Mauve database because it uses more RAM. ... query then the optimizer has to figure out what order to go after the data. ...
    (comp.databases)