Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Any way to get RowCount by not using Select count(*) from table

Re: Any way to get RowCount by not using Select count(*) from table

From: Eric Junkermann <eric_at_deptj.demon.co.uk>
Date: Sun, 17 Jan 1999 09:57:48 GMT
Message-ID: <369b9ac9.1445084@news.demon.co.uk>


On Mon, 04 Jan 1999 14:08:17 -0800, Dan Morgan <dmorgan_at_exesolutions.com> wrote:

>> If your table has a primary key (what table doesn't? :) )
>
>I know this is a segue but as a DBA I would really appreciate it if developers
>would STOP putting primary keys on EVERY table.
>
>For small static tables it takes twice as long for the SQL Engine to read the
>index and then read the table when a single read of the table would suffice.
>This same situation occurs in some cases with larger tables too. And this does
>not exactly enhance performance. If your concern is keeping the table in
>memory make it a cache table.
>
>Daniel A. Morgan

I think I know what you mean, but we should be careful here. The relational model says that every table has a primary key. If for performance reasons you wish to implement a table without an Oracle primary key, you need to know, and document, that this is what you are doing, as well as ensuring that whatever mechanism does update the table contains logic to ensure that the logical primary key is not violated.

Regards,

Eric. Received on Sun Jan 17 1999 - 03:57:48 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US