indexes on a table

Hello experts. I was told that I need to add indexes to my table, even if I'm just doing a select * from tbl_one. The index is actually justified in this case

Hello

user13328581 wrote:

Hello experts. I was told that I need to add indexes to my table, even if I'm just doing a select * from tbl_one. The index is actually justified in this case

No, if

Select *.

of tbl_one;

is exactly what you do, then any index on tbl_one will do everything (faster or slower).

If you have a WHERE clause, or an ORDER BY clause, or join you, or only some of the columns, then it's another story.

Ask the one who told you to explain.  Maybe you didn't understand what you were told correctly.

Tags: Database

Similar Questions

  • 'For' loop with a different number of iterations. Second, the auto-indexation of the tables with different sizes is done. It can affect the performance of the Vi?

    Hello

    I have a loop 'for' which can take different number of iterations according to the number of measures that the user wants to do.

    Inside this loop, I'm auto-indexation four different 1 d arrays. This means that the size of the tables will be different in the different phases of the execution of the program (the size will equal the number of measures).

    My question is: the auto-indexation of the tables with different sizes will affect the performance of the program? I think it slows down my Vi...

    Thank you very much.

    My first thought is that the compiler to the LabVIEW actually removes the Matlab node because the outputs are not used.  Once you son upward, LabVIEW must then call Matlab and wait for it to run.  I know from experience, the call of Matlab to run the script is SLOW.  I also recommend to do the math in native LabVIEW.

  • get the index of a table display

    Hello!

    I have a question. Is it possible to get the index of a current table in the front panel?

    I have 2 tables which need to scrool simultaneously to the user, so my idea was to read the index of a table and 'write' on the second.

    Can someone give me an idea how to do that?

    Thank you

    Dear Thiago Bach,

    recently, I did (for a similar question) an example on the control to the index of the two tables and bar a scroll, please find the attached VI.

    Good luck!

  • Creating indexes for the table

    can someone help me how to create indexes in the table. I m creating own table... I need to select a particular field in the table. So I need to calculate the index position. I use my code like this,

    This will returnthe number of columns in the table.

    Class array

    {

    private int Table_Index()
    {
    for (int x = 0; x)<>
    {
    table_index = x;
    }
    Return table_index;
    }

    }

    MainClass can I get this length of Index

    Table T1;

    int t1 is T1. Table_Index();

    This property returns my length (4) of table column

    Using this index (t1) I HAV to see what position I'm at table now...

    someone help me...

    You can use a listfield, he supports methods to get the selected row and its contents.

  • Partitioned global index on partitioned table range, but the index partition does not work

    Hello:

    I was creating an index partitioned on table partitioned and partitioned index does not work.

    create table table_range)

    CUST_FIRST_NAME VARCHAR2 (20).

    CUST_GENDER CHAR (1),

    CUST_CITY VARCHAR2 (30),

    COUNTRY_ISO_CODE CHAR (2),

    COUNTRY_NAME VARCHAR2 (40),

    COUNTRY_SUBREGION VARCHAR2 (30),

    PROD_ID NUMBER NOT NULL,

    CUST_ID NUMBER NOT NULL,

    TIME_ID DATE NOT NULL,

    CHANNEL_ID NUMBER NOT NULL,

    PROMO_ID NUMBER OF NON-NULL,

    QUANTITY_SOLD NUMBER (10.2) NOT NULL,

    AMOUNT_SOLD NUMBER (10.2) NOT NULL

    )

    partition by (range (time_id)

    lower partition p1 values (u01 tablespace to_date('2001/01/01','YYYY/MM/DD')),

    lower partition (to_date('2002/01/01','YYYY/MM/DD')) tablespace u02 p2 values

    );

    create index ind_table_range on table2 (prod_id)

    () global partition range (prod_id)

    values less than (100) partition p1,

    lower partition p2 values (maxvalue)

    );

    SQL > select TABLE_NAME, SUBPARTITION_COUNT, HIGH_VALUE, nom_partition NUM_ROWS of user_tab_partitions;

    TABLE_NAME NOM_PARTITION SUBPARTITION_COUNT HIGH_VALUE NUM_ROWS

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

    TABLE_RANGE P2 0 TO_DATE (' 2002-01-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIA 259418)

    TABLE_RANGE P1 0 TO_DATE (' 2001-01-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIA 659425)

    SQL > select INDEX_NAME, NUM_ROWS nom_partition, HIGH_VALUE user_ind_partitions;

    INDEX_NAME NOM_PARTITION HIGH_VALUE NUM_ROWS

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

    P1 IND_TABLE_RANGE 100 479520

    IND_TABLE_RANGE P2 MAXVALUE 439323

    SQL > EXECUTE DBMS_STATS. GATHER_TABLE_STATS (USER, 'TABLE_RANGE');

    SQL > EXECUTE DBMS_STATS. GATHER_TABLE_STATS (USER, 'TABLE_RANGE', GRANULARITY = > 'PARTITION');

    SQL > EXECUTE DBMS_STATS. GATHER_INDEX_STATS (USER, 'IND_TABLE_RANGE');

    SQL > EXECUTE DBMS_STATS. GATHER_INDEX_STATS (USER, 'IND_TABLE_RANGE', GRANULARITY = > 'PARTITION');

    SQL > set autotrace traceonly

    SQL > alter shared_pool RAS system;

    SQL > changes the system built-in buffer_cache;

    SQL > select * from table_range

    where prod_id = 127;

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

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

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

    |   0 | SELECT STATEMENT |             | 16469 |  1334K |  3579 (1) | 00:00:43 |       |       |

    |   1.  RANGE OF PARTITION ALL THE |             | 16469 |  1334K |  3579 (1) | 00:00:43 |     1.     2.

    |*  2 |   TABLE ACCESS FULL | TABLE_RANGE | 16469 |  1334K |  3579 (1) | 00:00:43 |     1.     2.

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

    Information of predicates (identified by the operation identity card):

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

    2 - filter ("PROD_ID" = 127)

    Statistics

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

    320 recursive calls

    2 db block Gets

    13352 consistent gets

    11820 physical reads

    0 redo size

    855198 bytes sent via SQL * Net to client

    12135 bytes received via SQL * Net from client

    1067 SQL * Net back and forth to and from the client

    61 sorts (memory)

    0 sorts (disk)

    15984 rows processed

    Once the sentence you say ' does not ' and then you go to paste plans that seem to show that it "works".

    What gives?

    In fact, if you look at the plans - think Oracle you have 16 k rows in the table and he'll be back k 12 rows for your select statement. In this case, Oracle is picking up the right plan - full scan 16 ranks of k is a lot less work to digitize the index lines k 12 followed by the research of rank k 12 rowid.

  • CTXCAT index on partitioned tables

    Hi all

    I use an oracle 11.2 database and try to use the index for a sample application oracle CTXCAT.

    I saw that oracle reference documentation "the CTXCAT index can't stand table and index partitioning, not...» "in http://docs.oracle.com/cd/B28359_01/text.111/b28303/ind.htm#BEIIEAFD

    But I was able to create a CTXCAT index on a partitioned table query to use it successfully.

    So can someone tell me exactly it meaning in the documentation of oracle developer "CTXCAT index does not support index and table partitioning?

    Thanks in advance,

    Mor.

    This simply means that you cannot create a LOCAL partitioned index on a table partitioned using the CTXCAT indextype. There is not probably the creation of a global index (ie. covering all partitions) on a partitioned table.

    The wording could be clearer.

  • Why I can't create indexes on the table of RDF data

    When I tried to create indexes on the table of RDF data, it always say the table or view does not exist. I created the RDF model using java codes:

    Oracle Oracle = new Oracle ("jdbc:oracle:thin:@localhost:1521:orcl", "system", "123");

    Chart GraphOracleSem = new GraphOracleSem (oracle, "test2");


    And used the following commands in sqlplus to create indexes:

    SQL >

    SELECT THE SEPARATE OWNER, OBJECT_NAME

    FROM DBA_OBJECTS

    WHERE TYPE_OBJET = 'TABLE '.

    4. AND OBJECT_NAME like ' % TEST2;

    OWNER

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

    OBJECT_NAME

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

    SYSTEM

    TEST2_NS

    SYSTEM

    RDFB_TEST2

    SYSTEM

    TEST2_TPL

    OWNER

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

    OBJECT_NAME

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

    SYSTEM

    RDFC_TEST2


    SQL > connect as sysdba

    Enter the password:

    Connected.

    SQL >

    SQL >

    SQL > select * from TEST2_TPL;

    Select * from TEST2_TPL

    *

    ERROR on line 1:

    ORA-00942: table or view does not exist

    SQL > CREATE INDEX test2_sub_idx ON TEST2_TPL (triple. GET_SUBJECT());

    CREATE INDEX test2_sub_idx ON TEST2_TPL (triple. GET_SUBJECT())

    *

    ERROR on line 1:

    ORA-00942: table or view does not exist

    Hi Shifu,

    It is not recommended to use the SYS or SYSTEM to store/manage schema graph RDF data.

    Can you please try the following in a SQL * more terminal?

    SQL > conn system/eu1

    Connected.

    SQL >

    SQL >

    SQL > create user graphuser identified by graphuser;

    Created by the user.

    SQL > grant connect, resources, unlimited tablespace to graphuser;

    Grant succeeded.

    SQL > conn graphuser/graphuser

    Connected.

    SQL > create table graph_tpl (triple sdo_rdf_triple_s) compress;

    Table created.

    SQL > sem_apis.create_sem_model exec ('graphic', 'graph_tpl', 'three');

    PL/SQL procedure successfully completed.

    SQL > insert into graph_tpl values (sdo_rdf_triple_s ('graph', '', '', ''));

    1 line of creation.

    SQL > select count (1) in the mdsys.rdfm_graph;

    1

    You see the same result?

    Thank you

    Zhe Wu

  • How to create faster index in the table of 500 GB

    Dear Experts,

    I have to create 20 index on table data-ware house. This table is of size 500 GB.

    freshen up this weekly chart using the external table.

    creating 20 indexes on this table consumes a lot of time.

    I have 40 GB of ram on 2012 box windows with 8 processors.

    I installed 11 GR 2.

    I have 4 drives C D E F

    for AN index, it takes 4 hours


    I added enough space to the tablespace

    I put the tablespace in a drive D:\


    I'm under control to create indexes below

    create index  X_3_INVEN_ITEM_ID_IDX  on   X_3_PV_TD_2 (INVENTORY_ITEM_ID)  parallel 32 nologging;
    
    

    output long ops

    SID, SERIAL # CONTEXT SOFAR TOTALWORK LESS TARGET % _COMPLETE TIME_REMAINING

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

    108 10 0 3758 140973 Rowid Scan AD range. X_3_PV_TD_2                                    2.67            256

    173 23 0 5279 141470 Rowid Scan AD range. X_3_PV_TD_2                                    3.73            258

    114 6 0 10092 141786 Rowid Scan AD range. X_3_PV_TD_2                                    7.12            261

    99         59          0      46283     325908 Sort Output                                                                                                                     14.2          15207

    68        214          0      46763     323623 Sort Output                                                                                                                    14.45          14973

    35         93          0      47531     318364 Sort Output                                                                                                                    14.93          14570

    164         70          0      45058     288506 Sort Output                                                                                                                    15.62          12886

    227         31          0      44130     282285 Sort Output                                                                                                                    15.63          13011

    13          3          0      51890     309515 Sort Output                                                                                                                    16.76          12874

    222 67 0 28837 141380 Rowid Scan AD range. X_3_PV_TD_2                                    20.4            343

    73 37 0 32472 141488 Rowid Scan AD range. X_3_PV_TD_2 22.95 212

    47 8 0 34332 141154 Rowid Scan AD range. X_3_PV_TD_2 24,32 202

    176 20 0 35197 141161 Rowid Scan AD range. X_3_PV_TD_2 24.93 205

    19 7 0 35239 141325 Rowid Scan AD range. X_3_PV_TD_2 24.93 205

    80 4 0 40399 141611 Rowid Scan AD range. X_3_PV_TD_2 28,53 193

    144 20 0 44960 141481 Rowid Scan AD range. X_3_PV_TD_2 31,78 182

    233 101 0 74086 169228 Rowid Scan AD range. X_3_PV_TD_2 43,78 176

    128 165 0 78765 141436 Rowid Scan AD range. X_3_PV_TD_2 55.69 173

    235 1 0 41199796 70035728 table Scan AD. X_3_PV_TD_2 58,83 19804

    199 6 0 52748651 70035728 table Scan AD. X_3_PV_TD_2 75,32-9709

    44 2 0 53686039 70035728 table Scan AD. X_3_PV_TD_2 76,66 9022

    204 26 0 119969 141464 Rowid Scan AD range. X_3_PV_TD_2                                   84.81             40

    202 48 0 138880 162276 Rowid Scan AD range. X_3_PV_TD_2                                   85.58             43

    17 33 0 126506 141778 Rowid Scan AD range. X_3_PV_TD_2                                   89.23             28

    48 7 0 137772 141360 Rowid Scan AD range. X_3_PV_TD_2                                   97.46             15

    Temp tablespace


    USED_MB USED TOT_MB % NOM_TABLESPACE

    ------------------------------ ---------- ---------- ----------
    TEMP 11533 286719 4.02

    temporary tables

    OWNER SEGMENT_NAME SEGMENT_TY TABLESPACE_NAME EXTENTS BYTES_
    ---------- ------------------------------ ---------- -------------------- ---------- ---------------
    AD 156.1601650 TEMPORARY USERS 96 209,715,200

    Question:

    How to fix this?

    (a) run several parallel create sqlplus statement index different sessions

    (b) create a tablespace to put data files in different hard drives like D: E: F: C:

    (c) create the separate tablespace for each hard drive and map it to a single disk IO benefit

    (d) I have 8 processors but parallel 32 is not speed

    (e) how these clues I can run in parallel. Is it OK to run 20 parallel index 32 sqlplus sessions

    All that I have to create 20 index on the table of 500 GB

    target memory = 30GB

    index of names to create 20, each index is 10 GB

    his is of 80 hours (4 hours per index)

    This machine is waiting, I just used all the resources of the machine to accelerate.

    Thanks for reading this

    Thanks for the help in advance

    I was talking about your end of issue speed up construction of index, where I proposed

    orclz >

    orclz > alter session set workarea_size_policy = manual;

    Modified session.

    orclz > alter session set sort_area_size = 2147483647;

    Modified session.

    orclz > create index

    Post edited by: JohnWatson

    Sorry, I misread it: this question was not from you. My apologies. My solution should work for you, however: give yourself a big PGA, manually. Automatic PGA management using not will never give you enough.

  • Creating Index on another table in schema stored in my table

    Hello
    I want to create indexes on a table column that is in another schema of my schema and index will be stored in my diagram.

    ex: the current user 'hr '.
    SQL > create index idx1 on scott.emp (eno);

    Does the above query?

    Thank you
    Sri
    SQL> conn
    Enter user-name: hr@****
    Enter password:
    Connected.
    SQL> create index ndx on scott.emp(sal);
    
    Index created.
    
    SQL> show user
    USER is "HR"
    
    SQL> select index_name from user_indexes where index_name = 'NDX';
    
    INDEX_NAME
    ------------------------------
    NDX
    
  • partition in maintained growth index, partition of table didn't need to add space.

    Version Oracle 11 g 1 material, OS is aix.

    We have a 100 to dataware house, are partitioned with the index.

    Each table move data 6 months previously and even with the index. However our table tablespace has not seen more, but index tablespace kept more and more, I have to keep adding spaces.

    How to address this issue? where to find the problem is?

    Thanks in advance.

    >
    I joined dba_segments with dba_objects to get nom_segment, owner, created, bytes/1024/1024 as this tablespace.
    . . .
    EVENT_TYPE_HGRAM_DEV STATS INDEX SUBPARTITION 28-SEP-05 DECEMBER 10 05
    1
    >
    Does not the validation of the application and the columns you listed do not match the data that you have posted.

    EVENT_TYPE_HGRAM_DEV - the name says a statistical histogram on the EVENT_TYPE table in the DEV environment. This object name means something to you?

    Enter you two dates but only "created" as a column. And what is the '1' represent?

    You also do not show an OWNER but mention a column 'owner '.

    Which table is, or has been, this index belong to? The table still exists? Have you purged the recyclebins?

  • Index on I$ Table

    Hi professionals,.

    I have the following indexes on the target table.

    CREATE INDEXES M23123MGR. SALE_IDX ON M23123MGR. DW_SALES_DIM
    (NVL("PKG_SALE_CODE",'-1'))
    LOGGING
    TABLESPACE WDSTAGE0T01
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE)
    INITIAL 1 M
    ACCORDING TO 1 M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    DEFAULT USER_TABLES
    )
    NOPARALLEL;


    CREATE INDEXES M23123MGR. SALE__ID ON M23123MGR. DW_SALES_DIM
    (PROJECT_SALE_CODE, CONTENT_ID)
    NOLOGGING
    TABLESPACE WDSTAGE0T01
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE)
    INITIAL 1 M
    ACCORDING TO 1 M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    DEFAULT USER_TABLES
    )
    NOPARALLEL;



    During execution of the ODI in interface the following M23123MGR. I have$ _DW_SALES_DIM is filled with the next index.

    CREATE
    INDEX M23123MGR. I HAVE$ _DW_SALES_DIM_ID ON M23123MGR. I _DW_SALES_DIM $
    (
    CONTENT_ID, PROJECT_SALE_CODE, PKG_SALE_CODE)
    NOLOGGING
    TABLESPACE WDSTAGE0T01
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE
    (
    INITIAL 1 M
    ACCORDING TO 1 M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    DEFAULT USER_TABLES
    )
    NOPARALLEL;



    The problem I encounter is that UPDATE the table takes too long. I need suggestions on how to call the same indexes in the table M23123MGR. DW_SALES_DIM in the M23123MGR table. I HAVE _DW_SALES_DIM$.

    There are at least 2 possible options to create indexes:

    (1) you can customize your KM to match your needs. You could look at the existing step 'create index' at km and change or add your own step "create index" in the same way.
    (2) also you might disable I drop $ objects optins in KM and manually create indexes on I$ table.

    But citing the index depends mainly on the OBC Oracle not ODI, ODI cause is E - LT technology.

  • Rebuild all indexes of a table

    DB version: 10.2.0.4

    Rather than rebuild indexes to help
    ALTER INDEX index_name REBUILD;
    y at - it a single command that would rebuild all indexes of a table?

    y at - it a single command that would rebuild all indexes of a table?

    No, but you can use

    select 'ALTER INDEX '||INDEX_NAME||' REBUILD' from user_indexes
    where table_name=

    And you can run this query.

  • dynamic SQL to drop the indexes on the table

    Hello world

    Please tell me how to remove the indexes on a table by using a dynamic sql code

    for example, I have a dummy table with two index idx1, idx2

    I need a procedure or a function where I will be passing in the name of the table, the function/procedure should remove the indexes on the table

    Thank you

    Not tested:

    create or replace
    procedure drop_indexes_of_table(p_table_owner varchar2,
                                    p_table_name varchar2)
    as                              
    
    cursor c_drop_statements is
    select 'drop index '||owner||'.'||index_name stmt
    from all_indexes
    where table_owner=p_table_owner
    and table_name=p_table_name;
    
    begin
      for r in c_drop_statements loop
        execute immediate r.stmt;
      end loop;
    end;
    
  • No index in my Table of contents

    FrameMaker 9 > Table of contents

    My book includes a TOC (table of contents) and the IOM (index) file.

    All of the chapters in my book have a chapter added to the "Title" tag title  The last "chapter" in my book is the file of the IOM.  In the IOM file, I have a 'Title' tag with the value "Index".

    When I generate my OCD, all the chapter in my book titles are listed, however, the Index get includes in the table of contents, even if I have the 'Title' tag included in my configuration of table of contents (see below).

    5-7-2011 4-32-35 PM.jpg

    So, how can I get the Index in the table of contents?

    Thank you.

    Sam

    Yes. FM is not look at the contents on the master pages. It only pulls the content from the active stream on the pages of your body.

    If you see the 'Index' string in your index file when you view the first page of the body, that is, it is set up in a block of background text on the first master page. Wrong place for this info if you need to put it in the table of contents - it must be on a page of body.

  • index of output table and show what LOCAL indexes and who are

    I read the view of ALL_INDEXES here:
    http://www.Stanford.edu/dept/ITSS/docs/Oracle/10G/server.101/b10755/statviews_1061.htm
    But I still don't know how to query follows:

    1. display the name of the table, the index name and flag Y/N 'Is the local index' and a flag "is the overall index.

    The application should output table index and show what indexes are LOCAL and which are not.

    How to write this query?

    My original request:
    select table_name, Index_Name, Uniqueness, Partitioned, decode(Partitioned, 'NO', 'Global','Local') GlobalOrLocal from all_indexes
    where table_name = 'MyTABLE'
    2 I understand that global index for partitioned tables is a chunk of data referencing all the partitions table in the single room, but Local index is partitioned itself there are several parts each one or more partitions to reference table?

    Published by: CharlesRoos on October 6, 2010 12:45 AM

    CharlesRoos wrote:
    I read the view of ALL_INDEXES here:
    http://www.Stanford.edu/dept/ITSS/docs/Oracle/10G/server.101/b10755/statviews_1061.htm
    But I still don't know how to query follows:

    1. display the name of the table, the index name and flag Y/N 'Is the local index' and a flag "is the overall index.

    The application should output table index and show what indexes are LOCAL and which are not.

    How to write this query?

    My original request:

    select table_name, Index_Name, Uniqueness, Partitioned, decode(Partitioned, 'NO', 'Global','Local') GlobalOrLocal from all_indexes
    where table_name = 'MyTABLE'
    

    That seems Ok to me.

    2 I understand that for partitioned tables index global is a big piece of data referencing all the partitions table in the single room,

    Yes.

    but the Local index is partitioned itself there several pieces for each reference one or several partitions table?

    Almost right: each refers to score exactly one table. I.e. index partitioning is 'aligned' with the partitioning of the table.

  • Maybe you are looking for

    • Slow run time

      Hello, I have a doubt.How can I speed up the enforcement process when a structure of the event have implemented?Greetings.Hugo Santos

    • Installation of ISE and ACS

      Hi all I have a problem to install ISE and ACS on VM server. Linux Redhat Enterprise is detected by the system when the iso file is selected. But some dependencies of the package are noticed as openssl kernel-devel or cisco... The installation will s

    • BlackBerry Curve 9360 - BIS Gmail - smartphones not to receive e-mail

      Hello! New owner of a bb, have not yet found the answer to my question on the forum. I have a Curve 9360 with two email address of the BIS. A post of administrator and Gmail. It has worked well. For 2 days, I get e-mails from Gmail by BIS and push. I

    • Recovery USB disk does not

      Had some problems with my dv6693, downloaded this app HP to make a recovery USB drive, he SAID it was completed successfully and I couldn't do any DVD so I thought, he MUST be. I tried on the original hard drive and it went into the "loading software

    • HP DV7-1010ep temperature

      Hi all I have a HP DV7-1010ep, a little more than a year and two weeks ago for my surprise it had to be repaired. I discovered that it's motherboard and CPU had to be replaced. The only reason why I can think of is that failure is linked, because the