difference in number of records

Hi all

I'm trying to get a number of records in this table and I get 2 different output, select count (*) shows 68560 and after update stats NUM_ROWS watch 68323, can someone help me figureout why the difference.

SQL > select count (*) in the dcepcd;

COUNT (*)
----------
68560

SQL > select num_rows in dba_tables where table_name = 'DCEPCD ';

NUM_ROWS
----------
68323

Thank you / JJ

864653 wrote:
Hi all

I'm trying to get a number of records in this table and I get 2 different output, select count (*) shows 68560 and after update stats NUM_ROWS watch 68323, can someone help me figureout why the difference.

SQL > select count (*) in the dcepcd;

COUNT (*)
----------
68560

SQL > select num_rows dba_tables where table_name = 'DCEPCD ';

NUM_ROWS
----------
68323

Thank you / JJ

When you gather stats, Oracle is probably just sampling the data. This means that Oracle would be approximately the number of lines, not give you the actual number of lines. Please read the documentation on DBMS_STATS:
http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25788/d_stats.htm

Here is a relevant excerpt:
Table 141-39 GATHER_DATABASE_STATS procedure parameters
estimate_percent
Percentage of rows estimate (NULL means calculates): the valid range is [0.000001,100]. Use the constant DBMS_STATS. AUTO_SAMPLE_SIZE to Oracle to determine the size of the sample appropriate for good statistics. It is the default value. The default value can be changed using the SET_DATABASE_PREFS procedure SET_GLOBAL_PREFS procedure, procedure SET_SCHEMA_PREFS and SET_TABLE_PREFS procedure.

Summary: You should get the actual number of lines if gather you stats with estimate_percent => NULL. Be aware that Oracle does not by default for performance reasons.

Tags: Database

Similar Questions

  • difference in number of records in the table of audit

    Hi all

    We strive to remove lines of verification based on timestamp(sysdate-30) table(sys.aud$). The command I used below.

    SQL > set lines 200

    COL OWNER FORMAT A15

    Select TABLE_NAME, nom_tablespace, OWNER, num_rows, STATUS, DEGREE, TABLE_LOCK, LAST_ANALYZED, PARTITIONED, USER_STATS from dba_tables where TABLE_NAME = '& TABLE_NAME';

    SQL > SQL > type table_name value: AUD$

    OWNER, TABLE_NAME, NUM_ROWS STATUS DEGREE TABLE_LO LAST_ANALY BY USING NOM_TABLESPACE

    --------------- ------------------------------ ------------------------------ ---------- -------- ---------- -------- ---------- --- ---

    SYS AUD$ 934991 SYSTEM VALID ACTIVE 1 08/07/2012 No. No.

    SQL > delete / * + parallel (aud$ 8) * / of sys.aud$ where NTIMESTAMP # < sysdate-30; (I don't know why I put NTIMESTAMP #, although I see # aud TIMESTAMP column $ table, the above query, I got from sr dba)

    3140994 deleted rows. (reason why so many records have been deleted I see 934991 lines from dba_tables view)


    After that I saw the difference in number of records.


    SQL > select / * + parallel (aud$ 8) * / count (*) from sys.aud$ where TIMESTAMP # < sysdate-30;

    COUNT (*)

    ----------

    0

    SQL > select / * + parallel (aud$ 8) * / count (*) from sys.aud$ where NTIMESTAMP # < sysdate-30; -> Why there are differences in the number of records if I put NTIMESTAMP #in query)


    COUNT (*)

    ----------

    50

    Thank you

    Bhavani.

    SQL > SELECT count (*) from sys.aud$ where ntimestamp #.<>

    COUNT (*)
    ----------
    0

    Try this one.  Good luck.

  • Make a difference in the number of records

    Hello

    Oracle9.2
    Windows


    Table A - records - 627255 total

    I want to pass some basic criteria records to a new table TAB_B, but implementation difference in number of records before and after the move.

    SELECT COUNT (*) FROM TAB_A WHERE the TIMING < (SYSDATE-150)-* 539911 *.

    CREATE TABLE TAB_B AS SELECT * FROM TAB_A WHERE the TIMING < (SYSDATE-150)

    SELECT COUNT (*) FROM TAB_B-* 539934 *.

    What can be the reason?


    Regarding

    SYSDATE is not static. It keeps ticking with impatience...

    And I suspect that you have a few 'ticks' between the time you did the count (*) and the create table.

  • Difference in the number of records for the same date - 11 GR 2

    Guy - 11 GR on Windows2005 2, 64-bit.

    BILLING_RECORD_KPN_ESP - is a monthly partitioned table.
    BILLING_RECORD_IDX #DATE - is a local index on "charge_date" in the table above.

    SQL > select / * + index (BILLING_RECORD_KPN_ESP BILLING_RECORD_IDX #DATE) * /.
    2 (trunc (CHARGE_DATE)) CHARGE_DATE;
    3 count (1) Record_count
    4. IN "RATOR_CDR". "" BILLING_RECORD_KPN_ESP ".
    where the 5 CHARGE_DATE = January 20, 2013.
    Group 6 by trunc (CHARGE_DATE)
    5 m

    CHARGE_DATE RECORD_COUNT
    ------------------ ------------
    2401 20 January 13-> > some records here.

    -> > Here I can see only '2041' records for Jan/20. But in the query below, it shows "192610" for the same date.

    Why is this difference in the number of records?

    SQL > select / * + index (BILLING_RECORD_KPN_ESP BILLING_RECORD_IDX #DATE) * /.
    (trunc (CHARGE_DATE)) CHARGE_DATE,
    2 count (1) Record_count
    3. FOR "RATOR_CDR." "" BILLING_RECORD_KPN_ESP ".
    "4 where CHARGE_DATE > 20 January 2013."
    Group of 5 by trunc (CHARGE_DATE)
    6 order by trunc (CHARGE_DATE)
    5 m

    CHARGE_DATE RECORD_COUNT
    ------------------ ------------
    192610 20 January 13-> > more records here
    JANUARY 21, 13 463067
    JANUARY 22, 13 520041
    23 JANUARY 13 451212
    JANUARY 24, 13 463273
    JANUARY 25, 13 403276
    JANUARY 26, 13 112077
    27 JANUARY 13 10478
    28 JANUARY 13 39158

    Thank you!

    Because in the second example you also select rows that have a nonzero component.

    The first example selects only rows that are 00:00:00

    (by the way, you should ask questions like this in the forum SQL)

  • difference in the number of records

    : The table DM_GBILL_STG_PERSON is my main table names containing 407052 records with field PERSON_ID, POSTAL_POST_CODE, POSTAL_CITY, Address1 address2.
    : Table DM_GBILL_SOU_PER_ADD_MAPP C is my temporary table that contains 113 records with ZIPCD, CITYCD domain names.

    Wat I have to do is return POSTAL_CITY as "BOMBAY" for

    So the first thing I have to do is to return POSTAL_CITY as "BOMBAY" for people whose postal_post_code in the table has to match with the zipcd in table C as I did in the Query1 by using A.POSTAL_POST_CODE = condition C.ZIPCD

    Second, I need to come back POSTAL_CITY like "BOMBAY" for people whose postal_post_code in the table does not correspond with the zipcd in table C that I made in the Query2.For what I hv used an A.POSTAL_POST_CODE condition! = C.ZIPCD and concatenated address1 and address2 to find the name of the city of temporary table C and its corresponding zipcd back and placing it in a table of POSTAL_ Class POST_CODE.

    So, the problem is that Query1 returns the correct number of records but Query2 returns records that are also present in Query1:

    Can anyone of you please suggest a solution.

    Query 1:

    SELECT A.PERSON_ID,
    (CASE
    WHEN A.POSTAL_POST_CODE = C.ZIPCD
    THEN "BOMBAY".
    ELSE 'MOMMY '.
    END) AS POSTAL_CITY
    OF DM_GBILL_STG_PERSON,.
    C DM_GBILL_SOU_PER_ADD_MAPP
    WHERE A.POSTAL_POST_CODE = C.ZIPCD

    Query 2:

    SELECT A.PERSON_ID, C.ZIPCD AS POSTAL_POST_CODE
    OF DM_GBILL_STG_PERSON,.
    C DM_GBILL_SOU_PER_ADD_MAPP
    WHERE
    SUBSTR (UPPER (A.ADDRESS1 |)) A.ADDRESS2), INSTR (UPPER(A.ADDRESS1 ||) (A.address2), C.CITYCD), length (Upper (C.citycd))) = Upper (C.CITYCD)
    AND INSTR(A.ADDRESS1 ||) A.address2, C.CITYCD) > 0
    AND A.POSTAL_POST_CODE! = C.ZIPCD

    Hello (and welcome)

    I don't know how this can be the case, but this should not return records that exist in the first query:

    SELECT A.PERSON_ID,C.ZIPCD AS POSTAL_POST_CODE
    FROM DM_GBILL_STG_PERSON A,
    DM_GBILL_SOU_PER_ADD_MAPP C
    WHERE
    SUBSTR(UPPER(A.ADDRESS1||A.ADDRESS2),INSTR(UPPER(A.ADDRESS1 ||A.ADDRESS2),C.CITYCD),LENGTH(UPPER(C.citycd)))=UPPER(C.CITYCD)
    AND INSTR(A.ADDRESS1 ||A.ADDRESS2,C.CITYCD)>0
    AND NOT EXISTS (
      SELECT 1
       FROM DM_GBILL_STG_PERSON A2,
      DM_GBILL_SOU_PER_ADD_MAPP C2
      WHERE A2.POSTAL_POST_CODE=C2.ZIPCD
         AND A.PERSON_ID = A2.PERSON_ID)
    
  • Copy from HDD to disc results external hard of different sizes but the same number of records

    Backup hard drive to external drive, 800 GB in total. When finished copying the file on the external drive size is smaller than 40 GB, but there is the same number of records.

    Different disks often present of thisdue fragmentation on each disk and the differences in the block sizes used on each disc. As long as all your data are present then there is no need to worry.

  • Can Notes show the number of records with each folder?

    Can Notes show the number of records with each folder?

    No it can't. It would be nice tho.

  • Electric trigger DAMA IQ &amp; check for new records to collect an infinite number of records

    Hi all

    I have some difficulties with the help of the trigger edge power IQ & questioning the DAMA if it has samples/records ready for pick up.  I have reviewed the documentation on the support to the screw and the examples provided with the driver of the ACCA and have not been able to solve my problem on my own.    What I'm trying to do, is to have this VI capture periodic RF bursts that are larger than a specified threshold.

    I go to this topic in the following way:

    I put the number of samples I captured (finished) for each burst which crosses the threshold
    I put the number of records to capture to be infinite
    I said that the rising slope and the appropriate threshold
    I have then to validate the configuration of the ACCA and start acquiring
    I have then go into a loop and check the backlog of samples as well as the acquisition is
    If either of the above is true then I get the samples with the IQ extract complex WDT vi
    I continue looping until the user stops the vi with a button on the front panel
    I went on this path that I didn't block indefinitely or for long periods of time

    What I see is:

    I'll take one shot and then nothing else
    what the samples never back above zero
    that acquisition is ever complete
    If I switch out the IQ extraction with equivalent IQ reading and ignore the completion back & I get documents like I expect

    My understanding is as follows:

    Electric trigger IQ does not have to be re-armed in VI
    that each trigger to fire IQ Power will create a new record containing the number of samples that I asked

    My questions:

    It seems that when the number of records is infinite that the acquisition is never considered as carried out when the State of the acquisition is verified, is that correct?
    I receive multiple records pending upward on the ASB using this configuration?
    Why a record number is provided with the back of fetch get VI?
    Why would I pick any folder, but the record of zero?
    I'm doing something wrong here?
    Is there a better way to do this?
        
    Thank you
    Russell

    Hi Russell,

    You are on the right track to get your application do what you want. Instead of check to fetch back, I suggest that lets you read the property node DAMA the "' Acquisition > Fetch > Records made" property to know when a new record was acquired. "

    > it seems that when the number of records is infinite that the acquisition is never considered as carried out when the State of the acquisition is verified, is that correct?

    That is right.

    > I get multiple records pending upward on the ASB using this configuration?

    Yes

    > Why a record number is equipped with the rear of fetch get VI?
    > Why would I pick any folder, but the record of zero?

    You ask DAA for an infinite number of records. File 0 started the first trigger seen. Record 1 to the second outbreak (end of disk 0) and so on.

  • Unable to get the total number of records processed by the processor of trade rules

    Details of the environment

    ======================

    Disqualification Version: 12.1.3.0.0


    I use a business rules processor to implement multiple business rules on one record and I am looking for a summary of the number of records increased and does not have a specific rule.


    To illustrate:
    Suppose there are 2 rules, invalid number in Column1 and valid number on Column2.
    10 records to process and 3 folders don't rule 1 (valid on column1) and 9 entered failure of rule 2 (valid number on Column2).

    In the browser of result of the processor Business, the number of past records and failed is displayed but is not part of the output of the processor itself. In the example above, there will be 1 pass and 9 fail records and given the values of said the total number of records can be derived which is 10.

    This is why the expected output will be:
    Success of failure
    Rule 1:7 (10-3) 3
    Rule 2: 1 (10-1) 9
    Note: The number of records that failed can be derived from the table of the rule ID but I don't know how to get the total number of records in order to calculate the number of records that a given rule.

    I tried to publish the County of acceptance and rejection in the browser of result of the processor Business in an intermediate table and ask the same intermediate table to get the pass and fail values but Disqualification does not allow to write and read the same intermediary object in a single process. What is the best way to get the number of records total handled by the processor business rules? This kind of attributes (that do not exist only in the browser of result) can be included in the output of the processor in the next version of the Disqualification?

    In addition, the intermediate table contains only 1 sheet with pass and failure values while the exceptions which have individual failure on each rule contains 12 Archives. What would be the best approach to merge a single record into multiple records according to the example below?

    Staging table
    Success of failure
    1 9

    Exception table
    Single ID ID rule
    Rule 1 Record1
    Rule 1 Record2
    Rule 1 record Record3
    Rule 2 Record1

    Exception table with: staging Table data merge
    Rule ID ID Unique Pass Fail Total
    Rule 1 1 9 10 Record1
    Rule 1 1 9 10 Record2
    Recording rule 1 Record3 1 9 10
    Record1 rule 2 1 9 10

    Please notify.

    Hi Jason,

    The best way to explain how to do this is with an example project (DXI). I'll send you one in offline mode.

    -Mike

  • Does Oracle 10g - Record Count/Total number of records.

    Hello, I'm looking to display the current records of number / total Records at the bottom left of a custom form. Please see below, made me know how this is done. Enjoy it!

    record_count.jpg

    Thanks, Naveen.

    Your question is unclear.  Forms already did what you mentioned and appears as such in the image you downloaded.  If you don't see it in a particular form, open the form in the report generator and check at the level of the 'form', property 'The Console window' is not NULL and properly reflects the name of the appropriate window.  A NULL value prevents the message bar appears.

  • How to determine the number of records in a subquery

    I am fairly new to Oracle SQL, and would like to know if anyone has examples of how to perform the following operations:

    1. I would return the number of rows that exist in the following SQL statement below. This SQL will be part of a larger SQL statement and I will be passing in the EMPLID identifier in the subquery. The result must be a value showing the total number of records that correspond to the SQL below. "xyz" will be finally passing through the extension number of the employee by using a reference to the parent SQL... ie: jbe. POSITION_NBR
    2. My SQL:

    SELECT Cjbe. EMPLID OF PS_JOB cjbe
    WHERE cjbe. POSITION_NBR = "xyz".
    GROUP BY cjbe. EMPLID

    I would like to know how I can change the value of poarent to POSITION_NBR (I think I use jbe.) POSITION_NBR) total calls the EMPLID found in this subquery subquery and then return.

    Thanks for your help.

    Maybe I lack something, but isn't this just

    SELECT count (distinct empl_id) from ps_job where position_nbr =: some_position_nbr

  • How can I recover only odd or even number of records in the table?

    Hello

    How can I recover only odd or even number of records in the table?

    Thank you

    Hi IndiMinds,

    Alternatively, you can use in queries. :

    Odd:

    SELECT *.

    Of

    (SELECT rownum row_count, id, name FROM bigemp

    )

    WHERE mod (row_count, 2) = 1;

    Still:

    SELECT *.

    Of

    (SELECT rownum row_count, id, name FROM bigemp

    )

    WHERE mod (row_count, 2) = 0;

    Thank you

  • Can I get the total number of records that meet the conditions of a query using the Table API?

    Hello

    A < row > TableIterator is returned when I ask operations using the index of tables. If I want to get the total number of records, I count one by one using the returned TableIterator < row >.


    Can I get the total number of records directly meets the conditions of the query?

    I can get the total number of records directly the request of the meeting of the conditions of CLI using the command Global table - name tableName - count - index index-name-field fieldName - start startValue-end endValue.

    Can I get the same results using the Table API?

    I used MongoDB and NoSQL Oracle for about a year. According to the experience of the use of these dbs, I think mongoDB querying interface is powerful. In the contras, the query interface is relatively simple, which results is a lot of work that is usually a long time in the client side.

    Hello

    Counting records in a database is a tricky thing.  Any system that gives you an accurate count of the records will have a hotspot of concurrency on updates, namely the place where the counting is maintained.  Such a count is a problem of performance in addition to competitive access problem.   The problem is even more difficult in a system widely distributed such a NoSQL database.

    The CLI has overall command that counts, but does so by brutal force - iterate keys that correspond to the parameters of the operation.  This is how you must do this within the API.  There is not a lot of code, but you have to write.  You certainly want to use TableIterator TableAPI.tableKeysIterator (), because a key iteration is significantly faster than the iteration of lines.  Just one iteration and count.

    If you use TableAPI.multiGet () and a key with a touch of brightness full then, in fact, count the results as they are returned in a single piece (a list).

    Kind regards

    George

  • I can capture the number of records retrieved by page in the Apex Interactive report?

    Hello

    I have a requirement in which I need to conditionally hide / show button on an interactive report.

    To achieve this, I need to compare the number of reows read by v/s lines page number to be

    read as specified by the user (defined using Actions-> lines per page).

    Please help me to know if there is a way to capture these 2 values:

    1. number of records retrieved in a report by page

    2. the value set by the user for the number of rows must be extracted (Actions--> lines per page).

    Quick help is really appreciated. Thank you.

    Hello

    You can use by jariola in his blog

    http://dbswh.webhop.NET/Apex/f?p=blog:read:0:article:41900346848694

    Thank you

    Benjamin

  • number of records displayed

    Hi all

    I have a report, each page has a number of records, but there is a space at the bottom of the page,

    I want to fill this space with records? How to do?

    How maximiza the number of records displayed?

    I tried the property of "maximum entries displayed" the extensible framework, but in vain,

    When I try 15 works, it shows 15 records, but when I try 30, it displays over 15 discs but not 30?

    Why?

    Thanks in advance

    Thank you

    the problem is that the margin should be extended to the bottom of the page.

    and by replacing the portrait report

Maybe you are looking for