1

Topic: How to accelerate select count (*) from table

The purpose quickly to count a real amount of all lines in a DB.
The variant with num_rows from dba_tables, does not approach - it is necessary to collect statistics.
parallel or something type dbms_parrallel too not to offer.
What else variants?

2

Re: How to accelerate select count (*) from table

murzus wrote:

the real amount of all lines in a DB

...  is not necessary for anybody, even approximate.

3

Re: How to accelerate select count (*) from table

Elic wrote:

it is passed...
...  it is not necessary for anybody, even approximate.

Do not tell, only 2 days ago satisfied the similar idiotic request  smile

4

Re: How to accelerate select count (*) from table

To add PK on the table, it is desirable on one small field if already there is also a speed of count count does not satisfy that to be satisfied this speed or to use approximate value (for example the same num_rows).

5

Re: How to accelerate select count (*) from table

Taciturn12;
Grants only the selective

6

Re: How to accelerate select count (*) from table

Taciturn12;

wrote:

the Purpose quickly to count a real amount of all lines in a DB .

....
stax

7

Re: How to accelerate select count (*) from table

Stax;
Or in DB tables

8

Re: How to accelerate select count (*) from table

murzus;
Strange desire to count all the line long....
If it  request - launch for the weekend.
If it on  is - think about Primary Key for all tables

9

Re: How to accelerate select count (*) from table

murzus;
Approximate
select 10 * count (*) from T sample block (10);

10

Re: How to accelerate select count (*) from table

MaximaXXL;
"Think about Primary Key for all tables" - it is possible more in detail?
There are tables without PK, to create they are there are no grants.

11

Re: How to accelerate select count (*) from table

With count (*) in oracle the slowest, it is better to use a variant count (1) - I prefer, though on productivity from count (ID) and count (field) strongly does not differ.

12

Re: How to accelerate select count (*) from table

MaximaXXL wrote:

murzus;
Strange desire to count all the line long....
If it  request - launch for the weekend.
If it on  is - think about Primary Key for all tables

What for the PC (can  not be) enough "not null" an index
If is not present,  create index i$t1 on t1 (0);
.....
stax

13

Re: How to accelerate select count (*) from table

murzus wrote:

MaximaXXL;
"Think about Primary Key for all tables" - it is possible more in detail?
There are tables without PK, to create they are there are no grants.

I so understand there are no grants at you. And I why that am assured that you know  at which nevertheless there is an access with the rights to creation PK.
.. You write on them the letter (or as you ) where ask to create PK for (the list of tables and fields) and to analyze consequences (here at all I do not represent that at you for basis) adding. In the letter specify for what to you these were necessary PK.

14

Re: How to accelerate select count (*) from table

orcl_1989 wrote:

with count (*) in oracle the slowest, it is better to use the Variant count (1) - I prefer, though on productivity from count (ID) and count (field) strongly does not differ.

a legend
ps
*
.....
stax

15

Re: How to accelerate select count (*) from table

MaximaXXL wrote:

it is passed...
I so understand there are no grants at you. And I why that am assured that you know  at which nevertheless there is an access with the rights to creation PK.
.. You write on them the letter (or as you ) where ask to create PK for (the list of tables and fields) and to analyze consequences (here at all I do not represent that at you for basis) adding. In the letter specify for what to you these were necessary PK.

As for what, for count k-va records by council MaximaXXL
....
stax

16

Re: How to accelerate select count (*) from table

Stax wrote:

as for what, for count k-va records by council MaximaXXL
....
stax

smile)) Well not itself the HARDWARE invented to itself the task of a line to consider though also such happen

17

Re: How to accelerate select count (*) from table

Except indexes anything is not present? (

18

Re: How to accelerate select count (*) from table

MaximaXXL;
At me the first script with dbms_sql was count of lines in circuit tables (itself invented) smile))
.....
stax

19

Re: How to accelerate select count (*) from table

what for to fence?
It is possible to manage rowid

20

Re: How to accelerate select count (*) from table

Fogel wrote:

  what for to fence?
It is possible to manage rowid

And you compare

21

Re: How to accelerate select count (*) from table

murzus wrote:

Except indexes anything is not present? (

In what a problem? Long? How often consider?
itself understands
Where there is an index - on it counts, where is not present -   the table
It is possible  index/index_ffs to specify, but whether it is necessary
.....
stax

22

Re: How to accelerate select count (*) from table

Fogel wrote:

  what for to fence?
It is possible to manage rowid

So, so...
And it is possible more in detail?

23

Re: How to accelerate select count (*) from table

murzus wrote:

it is passed...
So, so...
And it is possible more in detail?

What for to you the PC, , is enough fbi a constant ( 0) and the rights to creation of indexes
ps
I gave an example
.....
stax

24

Re: How to accelerate select count (*) from table

orcl_1989 wrote:

with count (*) in oracle the slowest, it is better to use the Variant count (1) - I prefer, though on productivity from count (ID) and count (field) strongly does not differ.

Where all? Elic? A photoshop? ?

25

Re: How to accelerate select count (*) from table

wrote:

it is passed...
Where all? Elic? A photoshop? ?

count (field) the result from */0 can cause a stir, and productivity too
.....
stax