What kind  of  index on limited number of distinct values in a large table

Hi all,
can any one help me
what kind of index on limited number of distinct values in a large table
Thanks,

Hi,
it's better to do full table scan when values are evenly distributed. Indexes are good when you want to select less than 10% of all data (it depends).
BUT you can use index when there is another data distribution - e.g. value 'Unprocessed' 1%, 'Processed' 99% (and you have computed statistics). Generally in datawarehouse you could use bitmap index, because it is small and fast, but it's not suitable in OLTP with many data modification. Then you can use b-tree index or functional index.
create index idx on mytable (decode('Unprocessed', 1, null));This funcional index will be small and fast too, because there won't be any null values (but you must use this clause in select statement to use index).

Similar Messages

  • [[DataDirect][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Column name or number of supplied values does not match table definition.]

    Hii ..
    need help on this ..
    This what I am doing ..
    I am using a DATAEXPORT function to export level0 data from my essbase 11.1.2.2 to Microsoft SQL 2008 tables.
    So what I did first I exported the level0 data to a flat file using DATAEXPORT and the created the SQL columns by the same  in that order only in my SQL table.
    When I run it fails with this error:
    ODBC Layer Error: [21S01] ==> [[DataDirect][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Column name or number of supplied values does not match table definition.]
    [Tue Jul 23 18:26:07 2013]Local/dataexp/dataexp/admin@Native Directory/1209813312/Info(1021014)
    ODBC Layer Error: Native Error code [213]
    [Tue Jul 23 18:26:07 2013]Local/dataexp/dataexp/admin@Native Directory/1209813312/Error(1012085)
    Unable to export data to SQL table [dataexp]. Check the Essbase server log and the system console to determine the cause of the problem.
    [Tue Jul 23 18:26:07 2013]Local/dataexp/dataexp/admin@Native Directory/1209813312/Info(1021002)
    SQL Connection is Freed
    [Tue Jul 23 18:26:07 2013]Local/dataexp/dataexp/admin@Native Directory/1209813312/Warning(1080014)
    Transaction [ 0x1c50001( 0x51ee7d66.0x80342 ) ] aborted due to status [1012085].
    [Tue Jul 23 18:26:07 2013]Local/dataexp/dataexp/admin@Native Directory/1209813312/Info(1012579)
    Total Calc Elapsed Time for [test.csc] : [1.44] seconds
    =============================================================
    I did a simple test on my Sample.basic application then ..
    loaded the calc data to it and then used the below script to export to a flat file
    //ESS_LOCALE English_UnitedStates.Latin1@Binary
    SET DATAEXPORTOPTIONS
                    DataExportLevel "Level0";
                    DataExportOverwriteFile ON;
                    DataExportColFormat OFF;
                    DataExportDimHeader OFF;
    FIX(
                "Jan",
                "Sales",
                "Actual"
    /*DATAEXPORT "File" "," "/home/hypadmin/samtest.txt";*/
    DATAEXPORT "DSN" "Abhitest" "sample" "sa" "welcome1";
    ENDFIX
    out put as below:
    "Sales"
    "100-30","California"
    "Jan","Actual",145
    Now In sql I created only 3 columns with name Jan/Sales/Actual and when I run this script again with comments removed .. I get the same error as what I have got in my first test case with other application ..
    but when I create the columns with same name as what its in export
    Sales/100-30/Califirnia/Jan/Actual
    It created the new rows successfully ..
    So with this I think the error which I am getting with my other application might be because of the same column issue  .. but then I have created all the columns by looking at the export file only as I did in sample ..
    Any idea would be helpful ..
    Thanks
    Abhishek
    I

    First make sure you add
    DataExportRelationalFile ON;
    to your set commands it is missing
    I alwats like to also add
    DataExportColHeader dimensionName;
    so I am sure what dimension is getting put into the columns.
    Then count the number of dimensions in your outline (exclude attribute dimensions). You need at least that many columns in your table  -1 + the number of  members you will be returning as columns in the export
    Taking your example Sample basic has 5 dimensions
    Measures
    Years
    Scenario
    Product
    Market
    Since you did not specify a dataexportcolheader it took the dense dimension Scenario as the columns. Your fix statement is limiting that to one member. Doing the math
    5 -1 + 1 = 5 columns in your table which is what you found works.  Suppose you fixed on bothe Actual and budget in scenario then you would need 6 columns 5 -1 +2

  • Column name or number of supplied values does not match table definition

    Buongiorno a tutti,
    sto cercando di inserire dei record in un database SQL, usando l'oggetto DB tools Insert data. Purtroppo però mi viene segnalato il seguente errore:
    "Exception occured in Microsoft OLE DB Provider for SQL Server: Column name or number of supplied values does not match table definition. in NI_Database_API.lvlib:Rec Create - Command.vi->NI_Database_API.lvlib:Cmd Execute.vi->NI_Database_API.lvlibB Tools Insert Data.vi"
    Il recod viene generato da Labivew usando l'oggetto concatanate string e i campi sono separati da tab. se esporto su Excel sembra tutto corretto e non ho errori. Le colonne del mio database corrispondono a quelle del record e sono tutte varchar. Vi allego la porzione di codice che genera il record.
    Suggerimenti?
    Grazie,
    Davide
    Allegati:
    db.png ‏5 KB

    Per qualche strano motivo l'editor ha convertuito la sequenza di caratteri ":" e  "D" in uno smile

  • Count number of distinct values for a column for all tables that contains that column

    Imagine I have one Column called cdperson. With the query below I know which Tables have column cdperson
    select
    t.[name]fromsys.schemassinnerjoin 
    sys.tables 
    tons.schema_id=t.schema_idinnerjoin 
    sys.columnscont.object_id=c.object_idinnerjoin 
    sys.types  
    donc.user_type_id=d.user_type_idwherec.name ='cdperson'
    now I want to know for each table, how many distinct values of cdperson I have and I want the result ordered by the table that has more distinct values (descending)
    Table1                                                                                     
       cdperson                        select distinct(cdperson) = 10
       cdadress
       quant
    Table2 with 
       cdaddress                      (no column cdperson in this table)
       quant
    Table3
       cdperson                        select distinct(cdperson) = 100
       value
    Table 4
       cdperson                        select distinct(cdperson) = 18
       sum
    I want this result ordered by number of distinct cdperson
    table3   100
    table4   18
    table    10
    Thks for your answers

    I had to add schema name to the above script to make it work in AdventureWorks:
    CREATE TABLE #temp(TableName sysname , CNT BIGINT)
    DECLARE @QRY NVARCHAR(MAX);
    SET @qry=(SELECT
    N'INSERT INTO #TEMP SELECT '''+schema_name(t.schema_id)+'.'+T.[name] +''' AS TableName, COUNT (DISTINCT ProductID) DistCount FROM '+
    schema_name(t.schema_id)+'.'+t.[name] +';'
    FROM sys.schemas s INNER JOIN sys.tables t ON s.schema_id=t.SCHEMA_ID
    INNER JOIN sys.columns c ON t.object_id=c.object_id INNER JOIN sys.types d ON c.user_type_id=d.user_type_id
    WHERE c.name ='ProductID'
    FOR XML PATH(''))
    EXEC(@QRY)
    SELECT * FROM #temp ORDER BY TableName
    DROP TABLE #temp
    Production.Product 504
    Production.ProductCostHistory 293
    Production.ProductDocument 31
    Production.ProductInventory 432
    Production.ProductListPriceHistory 293
    Production.ProductProductPhoto 504
    Production.ProductReview 3
    Production.TransactionHistory 441
    Production.TransactionHistoryArchive 497
    Production.WorkOrder 238
    Production.WorkOrderRouting 149
    Purchasing.ProductVendor 211
    Purchasing.PurchaseOrderDetail 211
    Sales.SalesOrderDetail 266
    Sales.ShoppingCartItem 3
    Sales.SpecialOfferProduct 295
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • NOT operator: What kind of index to create to prevent unindexed searches ?

    I see the following unindexed searches in my ODSEE (dsconf : 11.1.1.3.0 B2010.0630.2145) directory access log:
    [30/Sep/2011:11:42:04 +0200] conn=133 op=1 msgId=2 - SRCH base="ou=people,ou=.... " scope=1 filter="(!(employeeType=P))" attrs="mail sn givenName"
    [30/Sep/2011:11:42:28 +0200] conn=133 op=1 msgId=2 - RESULT err=0 tag=101 nentries=94312 etime=24 notes=U
    I've created an equality index on the employeeType attribute with a threshold of 130 000. I know that I have 4 possible values for the
    employeetype attribute, where at most 90000 entries have the same value. So, I don't understand why it's considered as an unindexed search.
    What index(es) and index parameter(s) should I create to have that kind of search match an index ?

    A while back Ludovic (I think) posted that there is no index for NOT. If you think about it, the usual index operation for equality, for example, has a key and value. The employeeType equality index key for "P" would have as its value a list of entryIDs that have the appropriate employeetype. So where would we get the list of entryIDs that don't have the value? Every key would need a corresponding negation key, containing the symmetric difference of ALLIDs with the original key. Computing it on the fly involves ALLIDs, which puts it right in to the unindexed category. Maintaining such a collection of indexes looks like a significant increase in processing time, I/O to the DB, and data size in the indexes. I'm guessing a bit of analysis on that may well show the cost is prohibitive. And in many cases any significant additional processing of this kind ought to be avoided. Maybe someone in ENG will chime in here with more details.
    But if you already know all the other values you are looking for, can't you do a compound OR filter and get them all that way? It may still be unindexed if the candidate list grows over time to be more than your ALLIDs threshold. To be frank this query does not look like something that ought to be indexed. It grabs a pretty large number of your users. Your ALLIDS threshold already looks too high to me. If this is a reporting query of some kind, I'd recommend either parsing an LDIF backup (if you don't need realtime data) or using a utility/reporting server that you can bog down with long-running queries. If you are already using a utility server for this, you can examine whether the query really needs to be indexed at all. It may not make sense to try to index it.
    As to why an operator would be available but not indexable, remember that the second major step of search processing examines each member of the candidate list and verifies a match on the filter. We routinely include filter components that we do not expect to assist in the creation of the candidate list, but we still want to be applied to the candidates during the filtering phase. For instance, consider the conventional filter (&(objectclass=person)(cn=XYZ)). In many Directories the objectclass filter component will evaluate to ALLIDs, and we want it to, because the cn component will have a much shorter list. We don't want the server to have to perform set intersection of a huge list of entryIDS (all the person objects) with the cn list. This is an example of how a too large ALLIDs threshold can hinder performance. We want the server to do the much easier intersection of ALLIDs with the short cn component list, because we know intersection of any subset of ALLIDs with ALLIDs is the subset. But we do want the server to check the candidates to make sure they really are person entries before returning them.

  • Insert Error: Column name or number of supplied values does not match table definition.

    I'm getting this error when I try to run my stored procedure, I have checked that the inserts matches the select, which seemed to be
    the issue for most of the time this question is asked. As far as I can tell they match so something else must be wrong.
    Code:-
    CREATE proc [dbo].[prc_ITEM_master_Customer]
    as 
    begin 
    set nocount on
    /****** Object:  Table [dbo].[tempdb..tmpWebCustomers]    Script Date: 03/05/2014 20:49:28 ******/
    IF  EXISTS (SELECT * FROM tempdb.sys.objects WHERE name = 'tmpWebCustomers' AND type in (N'U'))
    DROP TABLE tempdb..tmpWebCustomers
    CREATE TABLE tempdb..tmpWebCustomers
    [Customer Number] varchar(6),
    [Store Number] varchar(6),
    [Company Name] varchar(35),
    [Email Address] varchar(75),
    [Password] varchar(20),
    [Contact Name] varchar(20),
    [Phone] varchar(20),
    [Billing Address] varchar(40),
    [Billing City] varchar(30),
    [Billing State] varchar(2),
    [Billing Zip] varchar(10),
    [Billing Country] varchar(15),
    [Shipping Address] varchar(40),
    [Shipping City] varchar(30),
    [Shipping State] varchar(2),
    [Shipping Zip] varchar(10),
    [Shipping Country] varchar(15),
    [Payment Terms] varchar(1),
    [Prepaid Freight Amount] decimal(14,4),
    [Is Preferred] bit,
    [Fuel Surcharge Exempt] bit,
    [Sales Tax Addback] bit,
    [Broken Box Exempt] bit,
    [Canada Freight Exempt] bit,
    [Furniture Handling Exempt] bit,
    [Create At] datetime,
    [Updated At] datetime,
    [Sales Rep] varchar(50),
    [Sales Rep Phone] varchar(15),
    [Sales Rep Email] varchar(50),
    [Inside Rep] varchar(50),
    [Inside Rep Email] varchar(50),
    [Parent] bit
    --Insert All Non-National Account Customers--
    INSERT INTO tempdb..tmpWebCustomers
    SELECT
    C.CUSTNO as 'Customer Number',
    '' as 'Store Number',
    C.COMPANY as 'Company Name',
    RTRIM(C.EMAIL) as 'Email Address',
    C.MISC6 as 'Password',
    C.CONTACT as 'Contact Name',
    C.PHONE as 'Phone',
    C.ADDRESS1 as 'Billing Address',
    C.CITY as 'Billing City',
    C.STATE as 'Billing State',
    C.ZIP as 'Billing Zip',
    C.COUNTRY as 'Billing Country',
    '' as  'Shipping Address',
    '' as 'Shipping City',
    '' as 'Shipping State',
    '' as 'Shipping Zip',
    '' as 'Shipping Country',
    CASE
    WHEN C.PTERMS='CREDIT CARD' THEN 1
    WHEN C.PTERMS='CREDIT CART ONLY' THEN 1
    WHEN C.PNET=0 THEN 0
    ELSE 2
    END as 'Payment Terms',
    C.PPFREIGHT as 'Prepaid Freight Amount',
    C.PRPRICE as 'Is Preferred',
    C.FSEXEMPT as 'Fuel Surcharge Exempt',
    C.STADDBACK as 'Sales Tax Addback',
    C.BROKEN as 'Boken Box Exempt',
    C.CANADAFREIGHT as 'Canada Freight Exempt',
    C.FHEXEMPT as 'Furniture Handling Exempt',
    C.ADDDATE as 'Created At',
    C.LCKDATE as 'Updated At',
    RTRIM(R.SFIRST) +' '+ RTRIM(R.SLAST) as 'Sales Rep',
    R.PHONE as 'Sales Rep Phone',
    CASE
    WHEN R.EMAIL='[email protected]' then ''
    ELSE R.EMAIL
    END as 'Sales Rep Email',
    RTRIM(I.SFIRST) +' '+ RTRIM(I.SLAST) as 'Inside Rep',
    I.EMAIL as 'Inside Rep Email',
    0
    FROM tblARCUST C 
    INNER JOIN tblICSLSP R ON C.SALESMN=R.SLSMN
    LEFT OUTER JOIN tblICSLSP I ON R.INSIDESALES=I.SLSMN
    WHERE 
    C.NATION=0
    AND C.ACTIVE=1
    AND C.MISC6 !=''
    AND C.EMAIL like '%@%'
    --Populate Shipping Address Data--
    UPDATE tempdb..tmpWebCustomers
    SET 
    [Shipping Address]=RTRIM(S.ADDRESS1),
    [Shipping City]=RTRIM(S.CITY),
    [Shipping State]=RTRIM(S.STATE),
    [Shipping Zip]=RTRIM(S.ZIP),
    [Shipping Country]=RTRIM(S.COUNTRY)
    from tempdb..tmpWebCustomers W
    INNER JOIN tblARCADR S ON W.[Customer Number]=S.CUSTNO
    WHERE S.DEFASHIP='Y'
    UPDATE tempdb..tmpWebCustomers
    SET
    [Shipping Address]=[Billing Address],
    [Shipping City]=[Billing City],
    [Shipping State]=[Billing State],
    [Shipping Zip]=[Billing Zip],
    [Shipping Country]=[Billing Country]
    WHERE
    [Shipping Address]=''
    --Insert National Account Customers
    INSERT INTO tempdb..tmpWebCustomers
    SELECT
    C.CUSTNO as 'Customer Number',
    S.CSHIPNO as 'Store Number',
    S.COMPANY as 'Company Name',
    RTRIM(S.EMAIL) as 'Email Address',
    S.MISC6 as 'Password',
    S.CONTACT as 'Contact Name',
    S.PHONE as 'Phone',
    C.ADDRESS1 as 'Billing Address',
    C.CITY as 'Billing City',
    C.STATE as 'Billing State',
    C.ZIP as 'Billing Zip',
    C.COUNTRY as 'Billing Country',
    S.ADDRESS1 as  'Shipping Address',
    S.CITY as 'Shipping City',
    S.STATE as 'Shipping State',
    S.ZIP as 'Shipping Zip',
    S.COUNTRY as 'Shipping Country',
    CASE
    WHEN C.PTERMS='CREDIT CARD' THEN 1
    WHEN C.PTERMS='CREDIT CART ONLY' THEN 1
    WHEN C.PNET=0 THEN 0
    ELSE 2
    END as 'Payment Terms',
    C.PPFREIGHT as 'Prepaid Freight Amount',
    C.PRPRICE as 'Is Preferred',
    C.FSEXEMPT as 'Fuel Surcharge Exempt',
    C.STADDBACK as 'Sales Tax Addback',
    C.BROKEN as 'Boken Box Exempt',
    C.CANADAFREIGHT as 'Canada Freight Exempt',
    C.FHEXEMPT as 'Furniture Handling Exempt',
    S.ADDDATE as 'Created At',
    S.LCKDATE as 'Updated At',
    RTRIM(R.SFIRST) +' '+ RTRIM(R.SLAST) as 'Sales Rep',
    R.PHONE as 'Sales Rep Phone',
    CASE
    WHEN R.EMAIL='[email protected]' then ''
    ELSE R.EMAIL
    END as 'Sales Rep Email',
    RTRIM(I.SFIRST) +' '+ RTRIM(I.SLAST) as 'Inside Rep',
    I.EMAIL as 'Inside Rep Email',
    0
    FROM tblARCUST C
    INNER JOIN tblARCADR S ON C.CUSTNO=S.CUSTNO 
    INNER JOIN tblICSLSP R ON C.SALESMN=R.SLSMN
    LEFT OUTER JOIN tblICSLSP I ON R.INSIDESALES=I.SLSMN
    WHERE 
    C.NATION=1
    AND C.ACTIVE=1
    AND S.MISC6 !=''
    AND S.EMAIL LIKE '%@%'
    --Insert National Account Parents
    INSERT INTO tempdb..tmpWebCustomers
    SELECT
    C.CUSTNO as 'Customer Number',
    '' as 'Store Number',
    C.COMPANY as 'Company Name',
    RTRIM(C.EMAIL) as 'Email Address',
    C.MISC6 as 'Password',
    C.CONTACT as 'Contact Name',
    C.PHONE as 'Phone',
    C.ADDRESS1 as 'Billing Address',
    C.CITY as 'Billing City',
    C.STATE as 'Billing State',
    C.ZIP as 'Billing Zip',
    C.COUNTRY as 'Billing Country',
    C.ADDRESS1 as  'Shipping Address',
    C.CITY as 'Shipping City',
    C.STATE as 'Shipping State',
    C.ZIP as 'Shipping Zip',
    C.COUNTRY as 'Shipping Country',
    CASE
    WHEN C.PTERMS='CREDIT CARD' THEN 1
    WHEN C.PTERMS='CREDIT CART ONLY' THEN 1
    WHEN C.PNET=0 THEN 0
    ELSE 2
    END as 'Payment Terms',
    C.PPFREIGHT as 'Prepaid Freight Amount',
    C.PRPRICE as 'Is Preferred',
    C.FSEXEMPT as 'Fuel Surcharge Exempt',
    C.STADDBACK as 'Sales Tax Addback',
    C.BROKEN as 'Boken Box Exempt',
    C.CANADAFREIGHT as 'Canada Freight Exempt',
    C.FHEXEMPT as 'Furniture Handling Exempt',
    C.ADDDATE as 'Created At',
    C.LCKDATE as 'Updated At',
    RTRIM(R.SFIRST) +' '+ RTRIM(R.SLAST) as 'Sales Rep',
    R.PHONE as 'Sales Rep Phone',
    CASE
    WHEN R.EMAIL='[email protected]' then ''
    ELSE R.EMAIL
    END as 'Sales Rep Email',
    RTRIM(I.SFIRST) +' '+ RTRIM(I.SLAST) as 'Inside Rep',
    I.EMAIL as 'Inside Rep Email',
    1
    FROM tblARCUST C 
    INNER JOIN tblICSLSP R ON C.SALESMN=R.SLSMN
    LEFT OUTER JOIN tblICSLSP I ON R.INSIDESALES=I.SLSMN
    WHERE 
    C.NATION=1
    AND C.ACTIVE=1
    AND C.MISC6 !=''
    AND C.EMAIL like '%@%'
    end
    GO

    Cant spot anything obvious
    Are you sure you're running this in a new window? Make sure there's not any other bits of code present in window where you're running this.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • TRIGGERS TOPIC I AM GETTING ERROR AS Msg 213, Level 16, State 1, Procedure tr_employee1_insert, Line 6 Column name or number of supplied values does not match table definition.

    /*FIRST TABLE*/
    create table Employee1(
    empid int,
    empname varchar(20),
    salary int,
    gender varchar(10),
    depid int)
    insert into Employee1 values(1,'jitendra',500000,'m',100)
    /*2 ND TABLE*/
    create table audit(
    empid int,
    auditdata varchar(50)) 
     NOW I AM APPLYING TRIGGER
     /* triggers demo for after insert*/
     alter trigger tr_employee1_insert
     on  Employee1 for insert
     as begin
     declare @id int
     select @id=empid from inserted
     insert into audit values ('new employee is inserted with id=' + CAST(@id as nvarchar(5))+'is added at'+CAST(GETDATE() as nvarchar(20)))
     end
     insert into employee1 values (9,'shubham',110000,'m',200)
    PLEASE HELP ME TO SOLVE

     declare @id int
     select @id=empid from inserted
     insert into audit values ('new employee is inserted with id=' + CAST(@id as nvarchar(5))+'is added at'+CAST(GETDATE() as nvarchar(20)))
    This code will not properly handle a multi-row insert.  I suggest an approach like the example below instead of scalar variables.  Also, I suggest you just store the normalized data in the audit table (id, action, timestamp) instead of the
    formatted string.  That will facilitate subsequent queries and reporting on the data.
    ALTER TRIGGER tr_employee1_insert
    ON dbo.Employee1 FOR INSERT
    AS
    INSERT INTO dbo.audit (empid, auditdata)
    SELECT
    id
    , 'new employee is inserted with id=' + CAST(id as nvarchar(5)) + 'is added at ' + CAST(GETDATE() as nvarchar(20))
    FROM inserted;
    GO
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Index (or not) for excluding NULL values in a query

    Hello,
    I have table that can become very large. The table has a varchar2 column (let's call it TEXT) that can contain NULL values. I want to process only the records that have a value (NOT NULL). Also, the table is continuously expanded with newly inserted records. The inserts should suffer as little performance loss as possible.
    My question: should I use an index on the column and if so, what kind of index?
    I have done a little test with a function based index (inspired by this Tom Kyte article: http://tkyte.blogspot.com/2006/01/something-about-nothing.html):
    create index text_isnull_idx on my_table(text,0);
    I notice that if I use the clause WHERE TEXT IS NULL, the index is used. But if I use a clause WHERE TEXT IS NOT NULL (which is the clause I want to use), a full table scan is performed. Is this bad? Can I somehow improve the speed of this selection?
    Thanks in advance,
    Frans

    I build a test case with very simple table with 2 columns and it shows that FTS is better than index access even when above ratio is <= 0.01 (1%):
    DROP TABLE T1;
    CREATE TABLE T1
               C1 VARCHAR2(100)
              ,C2 NUMBER
    INSERT INTO T1 (SELECT TO_CHAR(OBJECT_ID), ROWNUM FROM USER_OBJECTS);
    BEGIN
         FOR I IN 1..100 LOOP
              INSERT INTO T1 (SELECT NULL, ROWNUM FROM USER_OBJECTS);
         END LOOP;
    END;
    CREATE INDEX T1_IDX ON T1(C1);
    ANALYZE TABLE T1 COMPUTE STATISTICS
         FOR TABLE
         FOR ALL INDEXES
         FOR ALL INDEXED COLUMNS
    SET AUTOTRACE TRACEONLY
    SELECT
              C1, C2
         FROM T1 WHERE C1 IS NOT NULL;
    3864 rows selected.
    real: 1344
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=59 Card=3864 Bytes=30912)
       1    0   TABLE ACCESS (FULL) OF 'T1' (Cost=59 Card=3864 Bytes=30912)
    Statistics
              0  recursive calls
              0  db block gets
           2527 consistent gets
           3864 rows processed
    BUT
    SELECT
         --+ FIRST_ROWS
              C1, C2
         FROM T1 WHERE C1 IS NOT NULL;
    3864 rows selected.
    real: 1296
    Execution Plan
       0      SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=35 Card=3864 Bytes=30912)
       1    0   TABLE ACCESS (BY INDEX ROWID) OF 'T1' (Cost=35 Card=3864 Bytes=30912)
       2    1     INDEX (FULL SCAN) OF 'T1_IDX' (NON-UNIQUE) (Cost=11 Card=3864)
    Statistics
              0  recursive calls
              0  db block gets
           5052 consistent gets
           3864 rows processed
    and just for comparison:
    SELECT * FROM T1 WHERE C1 IS NULL;
    386501 rows selected.
    real: 117878
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=59 Card=386501 Bytes=3092008)
       1    0   TABLE ACCESS (FULL) OF 'T1' (Cost=59 Card=386501 Bytes=3092008)
    Statistics
              0  recursive calls
              0  db block gets
         193850 consistent gets
         386501 rows processedHence you have to benchmark you queries with and w/o index[es]

  • Maximum number of key/value pairs in btree or hash database

    It's not clear to me from the documentation what the limit is on the number of key/value pairs in a Btree or hash database. The documentation on logical record numbers says that the db_recno_t type is a 32-bit unsigned type, "which limits the number of logical records in a Queue or Recno database, and the maximum logical record which may be directly retrieved from a Btree database, to 4,294,967,295". What does "directly retrieved" mean in this sentence? Does this mean that Btree is limited to 4,294,967,295 key/vaue pairs? If so, is this also the limit for a hash database?

    Hi mcgarvek,
    In case of Queue, Recno and Btree configured for logical record numbers - you can do that by setting DB_RECNUM flag: http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/db_set_flags.html#DB_RECNUM , the maximum number of records is 4,294,967,295 and after that limit, the next record will be inserted as record number 1.
    In case of Hash and Btree, the maximum database size depends on the page size selected by the application. Berkeley DB stores database file page numbers as unsigned 32-bit numbers and database file page sizes as unsigned 16-bit numbers. Using the maximum database page size of 65536, this results in a maximum database file size of 248 (256 terabytes).
    Database limits: http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_misc/dbsizes.html
    Logical record numbers: http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_conf/logrec.html
    Regards,
    Bogdan Coman

  • Row Insert Failed - Column name or number of supplied values does not match

    Hi ,
    I am trying add a new field to an existing table in MSSQL and access it in portlets,
    I added the new field in the table, and making necessary updations to the accessing java code seems to look fine. but when i insert the new rwo, fails with exception listed below.
    My code tidbits is as follows.
                   System.out.println("Column Location of outsidePhysician"+ aResultSet.findColumn("outsidePhysician")); // works and returns 24
                   if (anIntake.getOutsidePhysician() != null && !(anIntake.getOutsidePhysician().equals("")))
                        System.out.println("Now Alternate Physician will be added to resultset");
                        aResultSet.updateString(24, anIntake.getOutsidePhysician());
                        aResultSet.updateString("outsidePhysician",anIntake.getOutsidePhysician());
                        System.out.println("Now Alternate Physician already added to resultset"); // also printed
                   }else{
                        aResultSet.updateString(24, "new Physician");
                        aResultSet.updateString("outsidePhysician","new Physician");
                   //NOT NULL
                   aResultSet.insertRow(); // fails here
                   System.out.println("Inserted");
    The table has the right field name too, which is proved when i retrieve the fieldno, based on field name. I tried to delete the field and removing these changes work ok..
    Any ideas would be of help
    Thanks in Advance
    Usha
    [Microsoft][SQLServer 2000 Driver for JDBC]Row insert failed. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.base.BaseImplUpdatableResultSet.executeStatement(Unknown Source) at com.microsoft.jdbc.base.BaseImplUpdatableResultSet.insertRow(Unknown Source) at com.microsoft.jdbc.base.BaseResultSet.insertRow(Unknown Source) at com.microsoft.jdbcx.base.BaseResultSetWrapper.insertRow(Unknown Source) at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.insertRow(WSJdbcResultSet.java:2181) ... 14 more Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Insert Error: Column name or number of supplied values does not match table definition. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExce

    I haven't ever used that method of inserting rows, but from the example in the API documentation it looks to me like you have to callaResultSet.moveToInsertRow();before you callaResultSet.insertRow();Or are you just "inserting" the physician's name into existing rows of the database? If that's what you are doing then you need to callaResultSet.updateRow();Message was edited by:
    DrClap

  • What is the limited number of users?

    What is the limited number of users?

    WHile your question is a bit too vague to answer with certainty I'll start with a res[ponse and you can fine tune it if it is not what you are asking about.
    The number of users of any single product for a single user license at any given moment in time is one.

  • Got a call from 8207078890968 what kind of phone number is this?

    I got a call from 8207078890968 auto attendant saying my account was locked and to press a key to be connected with security department.  I hung up.  What kind of a number is 8207078890968?????

    Just got the same call. It said Express Mastercard and that my account had been locked and to press 1 to speak with someone. At that point I hung up. My husband, whose number is one number off from mine had gotten the call an hour or so before me and didn't answer. We both blocked the number.

  • I have a number - 999-999-9999 showing up as an incoming call on one of my phones.  Anyone know what kind of number this is?

    On the list of recent calls, I have a number - 999-999-9999 showing up as an incoming call on one of my phones  Anyone know what kind of number this is?

        bovine2, We can understand the importance of tracking call details. If you are logged in to your My Verizon account and you see the number is all 9's,0's etc the number has been restricted by the originating party. Are you only seeing this number for incoming calls?
    sheritah_vzw
    Follow us on Twitter
    @VZWSupport

  • What is Adobe tech supports phone number ?

    What is Adobe tech supports phone number ?

    Here you go..
    http://support.microsoft.com/gp/contact_microsoft_customer_serv?&fr=1
    MICROSOFT PERMIER SUPPORT  
    1-800-936-3100 
    Cheers,
    Gulab Prasad
    Technology Consultant
    Blog:
    http://www.exchangeranger.com    Twitter:
      LinkedIn:
       Check out CodeTwo’s tools for Exchange admins
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • I need in Formula Node to assign to the variable value 4000000000!!! What kind of variable it should be???

    i've just tryed to write unsigned in32, but it does not understand 'unsogned'... But i need variable to be unsigned, because the max value = 4000000000... So, how can i solve this probleme???

    Hi,
    I don't see exactly what you're trying to do here.
    Where do you want to assign the variable 4000000000 to? If you want it as an
    input, just use a dbl, with only zeros behind the coma.
    Note that an integer is a number without any decimals. An integer in LabVIEW
    is this, but with an extra limitation that it can only be 32 bits... So a
    dbl can be an integer.
    If the input dbl is not an integer, use round, round to -inf or round to
    +inf to make it one. This can also be done if the output needs to be an
    integer.Inside the formula node floor(x), int(x), intrz(x) or ceil(x) can be
    used to make integers.
    I hope this is what you mean... I can't see any problems doing this.
    Regards,
    Wiebe.
    "DrON" wrote in message
    news:506500000008000000E
    [email protected]..
    > I need in Formula Node to assign to the variable value 4000000000!!!
    > What kind of variable it should be???
    >
    > i've just tryed to write unsigned in32, but it does not understand
    > 'unsogned'... But i need variable to be unsigned, because the max
    > value = 4000000000... So, how can i solve this probleme???

Maybe you are looking for

  • Problem with rendered tables in JHeadstart 10.1.3.3.87

    Hi, We have recently upgraded from Jhs 10.1.3.3.52 to 10.1.3.3.87 (using JDev 10.1.3.4.0.4270) and have run into a problem with a window using regions. We have horizontal region containers, vertical region containers, stacked region containers and de

  • How can I add an Adobe Flash Plugin?

    I cannot find an "Adobe Flash Plugin" in my add-ons list. I search that name and it is not offerred to me. I have updated Firefox and downloaded the update for "Adobe Flash Player". Why won't it add a plug in? I'm running Mac OSX 10.6.8.

  • Special function 8 - Output Type

    Hi gurus, I created a new Output Type with special function 8 called ZPDF in transaction NACE with application MR (invoice verification) and I added to that Output Type ZPDF our custom program called ZXXX_ARCHIVE_LINK in order to post into the MM inv

  • Where to put methods?

    Hi folks, this isn't a Java dependant question but since I am coding in Java I will ask it here. I have a value object that contains a few attributes, accessor and persistence methods. We'll call the Class Player and it contains details of a person w

  • Itunes 7.0.2 problem - error 2330

    Guys, I have a big issue as I can't install i-tunes on my PC. Here is the message I have: ERROR CODE 2330. Could you please help ?... Thanks,