This action might not be possible to undo. Are you sure you want to continue?
A: Create a Excel spreadsheet with new and old names. Export the whole project as a dsx. Write a Perl program, which can do a simple rename of the strings looking up the Excel file. Then import the new dsx file probably into a new project for testing. Recompile all jobs. Be cautious that the name of the jobs has also been changed in your job control jobs or Sequencer jobs. So you have to make the necessary changes to these Sequencers.
2. Does the selection of 'Clear the table and Insert rows' in the ODBC stage send a Truncate statement to the DB or does it do some kind of Delete logic.
A: There is no TRUNCATE on ODBC stages. It is Clear table blah blah and that is a delete from statement. On an OCI stage such as Oracle, you do have both Clear and Truncate options. They are radically different in permissions (Truncate requires you to have alter table permissions where Delete doesn't).
3. Tell me one situation from your last project, where you had faced problem and How did u solve it?
A: The jobs in which data is read directly from OCI stages are running extremely slow. I had to stage the data before sending to the transformer to make the jobs run faster. B. The job aborts in the middle of loading some 500,000 rows. Have an option either cleaning/deleting the loaded data and then run the fixed job or run the job again from the row the job has aborted. To make sure the load is proper we opted the former.
4. The above might rise another question: Why do we have to load the dimensional tables first, then fact tables:
A: As we load the dimensional tables the keys (primary) are generated and these keys (primary) are Foreign keys in Fact tables.
5. How will you determine the sequence of jobs to load into data warehouse?
A: First we execute the jobs that load the data into Dimension tables, then Fact tables, then load the Aggregator tables (if any).
6. What are the command line functions that import and export the DS jobs?
A: A. dsimport.exe- imports the DataStage components. B. dsexport.exe- exports the DataStage components.
7. What is the utility you use to schedule the jobs on a UNIX server other than using Ascential Director?
A: Use crontab utility along with dsexecute() function along with proper parameters passed.
8. How would call an external Java function which are not supported by DataStage?
A: Starting from DS 6.0 we have the ability to call external Java functions using a Java package from Ascential. In this case we can even use the command line to invoke the Java function and write the return values from the Java program (if any) and use that files as a source in DataStage job.
9. What will you in a situation where somebody wants to send you a file and use that file as an input or reference and then run job.
A: A. Under Windows: Use the 'WaitForFileActivity' under the Sequencers and then run the job. May be you can schedule the sequencer around the time the file is expected to arrive. B. Under UNIX: Poll for the file. Once the file has start the job or sequencer depending on the file.
10. Read the String functions in DS
A: Functions like  -> sub-string function and ':' -> concatenation operator Syntax: string [ [ start, ] length ] string [ delimiter, instance, repeats ]
11. How did u connect with DB2 in your last project?
A: Most of the times the data was sent to us in the form of flat files. The data is dumped and sent to us. In some cases were we need to connect to DB2 for look-ups as an instance then we used ODBC drivers to connect to DB2 (or) DB2-UDB depending the situation and availability. Certainly DB2-UDB is better in terms of performance as you know the native drivers are always better than ODBC drivers. 'iSeries Access ODBC Driver 9.00.02.02' - ODBC drivers to connect to AS400/DB2.
Tuning should occur on a job-by-job basis. Try to have the constraints in the 'Selection' criteria of the jobs itself. Tuned the OCI stage for 'Array Size' and 'Rows per Transaction' numerical values for faster inserts. Staged the data coming from ODBC/OCI/DB2UDB stages or any database on the server using Hash/Sequential files for optimum performance also for data recovery in case job aborts. Worked with DB-admin to create appropriate Indexes on tables for better performance of DS queries 8. 10. 16. 7. 17. In Quality Stage we have many stages like investigate. 9. survivorship like that so that we can do the Quality related works and we can integrate with datastage we need Quality stage plugin to achieve the task. Using a constraint to filter a record set is much slower than performing a SELECT « WHERE«.Converts an expression to an output format. 5. 16. How did u connect to DB2 in your last project? A: Using DB2 ODBC drivers. 13. This may be the case if the constraint calls routines or external macros but if it is inline code then the overhead will be minimal. Removed the data not used from the source as early as possible in the job. Tuned the 'Project Tunables' in Administrator for better performance. made. How did you handle reject data? A: Typically a Reject-link is defined and the rejected data is loaded back into data warehouse. 11. What are OConv () and Iconv () functions and where are they used? A: IConv() .Used for collecting the partitioned data. Sorted the data as much as possible in DB and reduced the use of DS-Sort for better performance of jobs 6. where you can create. How did you handle an 'Aborted' sequencer? A: In almost all cases we have to delete the data inserted by this from DB manually and fix the job and then run the job again. 3. Used sorted data for Aggregator. The following are different types of routines: 1) Transform functions 2) Before-after job subroutines 3) Job Control routines 18. This will eliminate the unnecessary records even getting in before joins are 12. 15. 14. 21. Constraints are generally CPU intensive and take a significant amount of time to process. make sure that there is not the functionality required in one of the standard routines supplied in the sdk or ds utilities categories. If worked with DS6. 14.0 and latest versions what are Link-Partitioner and Link-Collector used for? A: Link Partitioner . Meta Data defines the type of data we are handling. 4. 20. Rejected data is typically bad data like duplicates of Primary keys or null-rows where data is expected. What are Routines and where/how are they written and have you written any routines before? A: Routines are stored in the Routines branch of the DataStage Repository. Try not to use a sort stage when you can use an ORDER BY clause in the database.12. 15. Use the power of DBMS. What are Sequencers? A: Sequencers are job control programs that execute other jobs with preset Job parameters. match. If an input file has an excessive number of rows and can be split-up then use standard logic to run jobs in parallel. Before writing a routine or a transform. So Reject link has to be defined every Output link you wish to collect rejected data. 19. 13. This Data Definitions are stored in repository and can be accessed with the use of MetaStage. Link Collector . Bulk loaders are generally faster than using ODBC or OLE.Converts a string to an internal storage format OConv() . view or edit. 2. Do you know about INTEGRITY/QUALITY stage? A: Qulaity Stage can be integrated with DataStage. Make every attempt to use the bulk loader for your particular database. Do u know about METASTAGE? A: MetaStage is used to handle the Metadata which will be very useful for data lineage and data analysis later on.Used for partitioning the data. . Converted some of the complex joins/business in DS to Stored Procedures on DS for faster execution of the jobs. What are other Performance tunings you have done in your last project to increase the performance of slowly running jobs? A: 1. updates and selects.
0 server before the upgrade. This step is for moving DS from one machine to another. What is DS Director used for? A: datastage director is used to run the jobs and validate the jobs.22. username. 29. It is also used in-place of ODBC. What is Hash file stage and what is it used for? A: Used for Look-ups. There is NO rework (recompilation of existing jobs/routines) needed after the upgrade. Either the values are coming from Job Properties or from a µParameter Manager¶ ± a third part tool. password. The often Parameterized variables in a job are: DB DSN name. 5) In case if you are just upgrading your DB from Oracle 8i to Oracle 9i there is tool on DS CD that can do this for you. 4) Make sure that all your DB DSN's are created with the same name as old one's. There is no way you will hard±code some parameters in your jobs. and add links.0 install process collects project information during the upgrade. and.X. Did you Parameterize the job or hard-coded the values in the jobs? A: Always parameterized the job.dsx file 2) See that you are using the same parent folder for the new version also for your old jobs using the hard-coded file path to work. 31. 24. What is DS Administrator used for? A: The Administrator enables you to set up DataStage users. 27. OCI tables for better performance. The Designer graphical interface lets you select stage icons. version 7. In general we use Type-30 dynamic Hash files. 26. The Data file has a default size of 2Gb and the overflow file is used if the data exceeds the 2GB size.T for the data to be looked against at. What is DS Designer used for? A: You use the Designer to build jobs by creating a visual design that models the flow and transformation of data from the data source through to the target warehouse. Have you ever involved in updating the DS versions like DS 5. we can go to datastage director from datastage designer it self. if National Language Support (NLS) is enabled. It is like a reference table. Explain the differences between Oracle8i/9i? A: Oracle 8i does not support pseudo column sysdate but 9i supports Oracle 8i we can create 256 columns in a table but in 9i we can upto 1000 columns(fields) 23. 30. dates W. 3) After installing the new version import the old project(s) and you have to compile them all again. You can use 'Compile All' tool for this. How do you merge two files in DS? A: Either use Copy command as a Before-job subroutine if the metadata of the 2 files are same or create a job to concatenate the 2 files into one if the metadata is different. install and manage maps and locales. 25.R. The following are some of the steps. drop them onto the Designer work area. control the purging of the Repository. What is DS Manager used for? A: The Manager is a graphical tool that enables you to view and manage the contents of the DataStage Repository 28. I have taken in doing so: 1) Definitely take a back up of the whole project(s) by exporting the project as a . . What are Static Hash files and Dynamic Hash files? A: As the names itself suggest what they mean. if so tell us some the steps you have taken in doing so? A: Yes. 6) Do not stop the 6.
This will remove the headers from your columns. How to improve Report performance in ReportNet? By aggregation.Highlight the report. 2. for example if you have a user or group of users who you donâ¼t want access to a particular Namespace then you can remove access to that Namespace for that user or group of users. What is catalog and types of catalogs in cagonos? A catalog is a file containing the information (Database tables) that Impromptu users need to create reports. check the joins. click Data and select the calculated column you created and insert it into the report. How to join multiple db in catalog? Mutiple database could not be connected in a single catalog. . query subjects. query items. one can schedule the running reports in Impromptu to execute and save it in desired format. Always try to use appropriate functionality which can save time in this way you can improve performance of a report. from the Insert menu.How can I create a dynamic column name in Cognos? 1.Clear the Column Title Header check box. filters and folders. Also drill through functionality increases performance as well.Select Properties. Try to use less filters in the report.Reinsert the rest of the column headers. 3. What is object security in framework manager? Object security restrict access to specific objects in a project. and then right-click.Create a calculated column which contains the information that the header is to contain. such as "Report for year 1999" (concatenated text and date to string sub string extraction). insert text will work. and then click the Headers/Footers tab. Use star schema grouping. 4. For the dynamic column. Objects which can have security applied include namespaces. Drill through report means to extract the data by selecting a column in a report. You can either Allow (make visible) or Deny (not visible) access to these objects. 5. So that we use hotfile for this purpose. means to get the detailed information by clicking that column data. personal distributed shared secured What is the difference between a cascading report and drillthru report?why do we go for drill thru report? Cascading prompt means to extract the data from one prompt to using values from another prompt. How can i schedule reports in cognos? By using Cognos Schedular.
Order No. What is Cognos Visualizer and Cognos Scripting? Cognos Visualizer:Cognos Visualizer provides powerful visual analysis to communicate complex business dataquickly and intuitively.By using Cognos MACRO script language the reports can be executed and distributed to recipients by using mail applications. 1. What is snapshot? A Snapshot is the copy of data. By going beyond simple pie or bar graphs. using that we can generate cube. IQDReportNet> . How to generate cubes in cognos? Power Play Transformer contain dimension.You can associate one or more data items with a grouped data item. we use snapshot when ever we want to compare reports(ex we want to compare this months report with previous months) What is meant by Junk Dimension? The junk dimension is simply a structure that provides a convenient place to store the junk attributes What is IQD?What is contained in IQD? How you create IQD In ReportNet FrameWork? 1. there is an Order Date. You can organize your report by grouping on one or more data items.A macro is a set of commands that automates the running of an application. Impromptu sorts the data item you are grouping and removes duplicatevalues. For each order number. and other indicators.model and cube. You can automatemost Cognos Business Intelligence applications by using the Cognos Script language (a BASIC-like language) the Cognos Script Editor. Slicing and Dicing: While you can drill to look at information at any level. and OLE automation What is the difference between group and associare? When you group data. trends. Create a new namespace.By associating a grouped data item to another data item. or any other OLE compliant editor to create.measure. you can slice and dice to select the exact information you want in your report. and run macros. when we create a snapshot it copies the exact data that's related to the at perticular report. Compiled Cognos MACROs can be scheduled using Cognos Schedular. For example. drilling up moves you up in the hierarchy.compile. we can write script in unix. An associated data itemshould have a one-to-one relationship with the grouped data item.<give it a name. Drilling down moves you down in the hierarchy. you can eliminate duplicateinformation from your report. say. Just right click on cube name and build 2. and Order Datehave a one-to-one relationship. you can view and combinedata in a way that lets you immediately see areas of concern. Order No. modify. we can generate cube different way. What is drill down and slicing and dicing whats the difference between them? Drilling lets you quickly move from one level of detail to another to explore different aspects of your business. is agrouped data item.Cognos scripting:You can use the Cognos Script editor.
select the funtion list(DB). pull in all the data you need. it will specify the the error. 3. If there will be any error. u need to create a package. No Loop: T1 ---> T2 ---> T3 ---> Alias (or) Shortcut of T1 What is the security module used in cognos? Cognos uses KERBORES security model. to Publish. select "IQD" from the drop down menu of externalizeMethod. a WIZARD will open. From Left Pane Select Particular Column which you wants to Rename Drag that into Right Pane then Select that Column and Click on Rename Button then Change the name. after creating. we have to create a shortcut (or) Alias to the Table T1. How do you change the Name of those columns? Open Impromptu Administrator -> Catalog -> Folders option Select the column you want to Click the Edit button. if we have '3' tables T1. unless it will give message -'report specification is valid'. select the location from the WIZARD 4.In the query subject definition window. 2. DONE. T2. . For example. It was the model which was found in 1980. select language. When You Import data into catalog You have complex columns names.2. from the properties pane. What is loop in frameworkmanager ? Loop: loop is a closed path (relation) that exists among 3 (or) more tables. T3 then. a loop exists among these tables only when we create joins in the following fashion: Loop: T1 ---> T2 ---> T3 ---> T1 To resolve the above problem. Create a new query subject inside IQDReportNet. add security. 1. Publish the package. click on the new query subject. create a new package. How can i test reports in cagonos? In cognos report net by the validate report option a report can be tested. Name the new Package. 4. select the IQDReportNet object from the project. 3.
What is the complex job you have created ? tell me the logic of that complex job? 5.5 (Enterprise Edition ) & Standard Ascential DataStage 7. How to remove blank spaces from data? 45. Does truncate option is available for ODBC ? 77.export-import and Version control. Can one combine pipeline & partition parallelism? How and when? 47. how exactly we use stored procedures? Explain steps briefly? 80. how do u convert date in 20-12-07 to dec-20-2007 or 20-dec-2007 or 20-dec-07 in parallel jobs? 10. What is Clear Status File and when do you use it? 42. What is parallel execution in oracle? 52. Could DataStage generate test cases? 46. what is unique function ? where can I find it? how it can delete duplicate records? 79. where the log files or tables can store in DS? 16.5 Version ? 56. is it possible to access the same job by two users at a time in DataStage? 12. how many nodes per partition 33.1 from data stage 6. What are the new features of Datastage 7. what r wrappers ? 49. What is Bitmap and B-Tree indexes ? 53. In 4 jobs 1st job is aborted after loading 65000 records instead of 100000 records . What is the diffrence between the Dynamic RDBMS Stage & Static RDBMS Stage ? 57. how do we create index in data satge? 55. where we use config file as parameter ? tell me in the project? 18.. how input data is node partitioned 31. what are . What is Ad-Hoc access? What is the difference between Managed Query and Ad-Hoc access? 38. dataset use? 36. How to enable the datastage engine? 58. how to attach a mtr file (MapTrace) via email and the MapTrace is used to record all the execute map errors 60. routine. how to drop the index before loading data into target and how to rebuild it in DS? 13. value ? Name of an Orchestrate operator to call. OLAP uses which index ? 64. How can I know which Job is working on which node? 6. how will u design file watech jobs? 63. Different ways a project can be moved to production ?. how can we create rank using datastage?what is the meaning of rank? 9. how do u reduce warnings 30. when exactly we use nested tables ? 66. What is the diffrence between IBM Web Sphere DataStage 7. Are there any configurations restrictions ? for particular node? 48. what are range lookups? 67. root tree will find which is server job and which is parallel job? 8. sparse lookup where its option in oci or db2 28. if we using two sources having same meta data and how to check the data in two sources is same or not? and if the data is not same i want to abort the job ?how we can do this? 26. memory wise difference between lookup merge and join 27. What is Cleanup Resources and when do you use it? 43. then how can u load the rest of the records into target? 81. what are the problems u faced in u r project? 76. if RCP disabled what happen? . peekstage and pivot its practical use 29. how do u clean the DS repository? 15. What is page size/array size in oracle? 51. What is Orchestrate options in generic stage. How can one tune SQLâ¼s in Oracle? 54. use of correlated query? 65. how do u do SQL tuning? 71. what is meaning of instance in DataStage? explain with example ? 14. what is use of SDR function? 2. what is buildups? And its use? 50. how did you handle aborted sequencer? 73. Is there any possibility to generate alphanumeric surrogate key? Explain briefly? 20.example â¼¦. job locking methods? How can we unlock the job? Explain in briefly? 19. what is job control ? what is the use of it explain with steps? 11. what is the meaning of â¼ pre load into memoryâ¼ in hash file? 72. how can we create read only jobs in DS? 17. CLI stands for? 70. what are the orchestrate operators available in datastage for AIX environment 61. how can we get basic transformer in parallel jobs? 23. I s there any in-built transform for surrogate key? 3. What are the various reports that could be generated using this Datastage? 44. how can I know no of nodes in unix? And which are working at present? 7. in parallel jobs in particular job how can I abort the job after 50 warnings ? and where I find check point for the particular job? (not in sequencer or job sequence) 75.ctl(control files) files ? how the dataset stage have better performance by this files? 21. how can we view the data of dataset from hard disk? Not from rightclick view data? 22..1. how exactly schedule ur jobs ? file watcher jobs ? command watcher jobs? 37. how node connect with cpu 35. exact difference between Transform. in Unix â¼³ what is poll? 74.1 24. Type 30D hash file is GENERIC or SPECIFIC? 59. what is connected and unconnected lookups? 68. what is the use of DSattchJob?DetachJob? where can we find it? 4. involvement in unit testing 32. 39. how do u catch bad rows from OCI stage? 69. is the difference between DataStage and DataStage Scripting? 25. scripting means? Explain briefly How it controls the job? 62. How do you get log info into a file? 41. Have u written any custom routines in your project? If so explain 40. function? 78. datastage telnet tool where it is and use 34. what are the option names.
I just don't want to feed the addiction. Don't get me wrong. I can't concentrate on anything until I've read the manual from cover to cover and found out everything it can do. difference between routine and subroutine? 85. . tell me about OSH? What is the use? Where we use it? 83. if we get any fatal error with error code no. In sort remove duplicate is possible then why we separately we go for remove duplicate stage? 95. how can we convert date(dd/mm/yy)into Julion date in parallel jobs? 88.rakesh. When I do get a new piece of technology though. every built-in gizmo.suraj. How lock happens to the job ? particularly I want to lock the job how I lock the job? 89.madhan. and every trashy piece of after-market merchandise that can be plugged into it.82. how to debug with that error code no? Understanding Indexes Submitted by rleishman on Sun. there's no shortage of people who can peel off a half-hour litany on their new Blackberry/IPod/Notepad/Digital Watch within a day of purchase. if a column contains data like ram. how to use rank and update strategy in DataStage? 87. why we prefer oracle sequence rather than dataStage routine? 91. what is conformed dimension layer? 94.. And I don't think I'm alone here. difference between inline query and subquery? 93. In the director of job view log.pradeep. 2007-02-04 04:06 y RDBMS Server Of iPods and Indexes I'm not really an "early-adopter" of technology. How we find no of records in Hash file? 92. where we find log tables ? 90.bhaskar then I want to place names separated by commas in another columns how can we do? 96. difference between Interprocess and Inprocess? 86. it's like a fever. plz tell me about DataStage versions releasing years? 84.T. I love it. Working in I.
Always add 1 to include the leaf level. Curious? Try this: SELECT index_name. All data in Oracle tables. so the process is repeated. so b-Trees are typically quite shallow. 99 times out of a 100 you don't need the suck-it-and-see methodology because you know beforehand whether an index will help? What is an Index? This is covered in the Oracle Concepts manual. This tells us that page 350 starts with Fyshe and that page 351 starts with Garibaldi. Oracle uses two different index architectures: b-Tree indexes and bitmap indexes. A block . The names on each page are sorted. Rows in a table are usually much smaller than this. indexes. really. Minimising this wastage is one of the fundamentals of Oracle Performance Tuning. Oracle cannot read a single name (row) and ignore the reset of the page (block). bitmap join indexes. so we will come back to Bitmap indexes another time. COLUMN object_id NEW_VALUE object_id . This is how the branch-blocks of an index work.when sorted correctly . I could've made a fortune in commissions. If you're really. or 32Kb. blevel+1 FROM user_indexes ORDER BY 2. The "-Tree" in b-Tree A b-Tree index is a data structure in the form of a tree . In a large phone book.So why are databases different? I worked with Oracle databases for 5 years before I understood indexes . for those interested). one-ness with indexes. o o Each page in the book (leaf block in the index) contains many entries. creating the next level up in the index. so many rows will generally fit into a single block. This tells us that page 6 starts with Fermat and that page 7 starts with Hawking. we: o o o Read page 1. I distinctly remember my first tuning methodology: "It's running slow. So you never read "just one row". which is usually in a larger font in the page header. I mean just a basic understanding of the mechanics of the things. this reduced list containing one entry per page will still cover many pages. we may find it convenient to create a separate ordered list containing the first name on each page of the phone book along with the page number. beacuse we have mastered "the flick" .is the smallest unit of disk that Oracle will read or write. a reduced list that contains the first row of each block plus the address of that block. I have never seen an index with more than 5 levels. of course.is stored in blocks. Imagine the leaf blocks of the index as the pages of a phone book. 8Kb. Blocks First you need to understand a block.but it is a tree of database blocks. Read page 6. not rows. this tells you the number of blocks a unique index scan must read to reach the leaf-block. try this in SQL*Plus: ACCEPT index_name PROMPT "Index Name: " ALTER SESSION SET TRACEFILE_IDENTIFIER = '&index_name'.the ability to fan through the book looking for the page that will contain our target without reading the entire page. If you understand how indexes work. spiritual.no surprises there . 16Kb. 3 blocks to find a specific row in a million row table. reverse key indexes and text indexes are all just variations on the two main types. I don't mean a deep.and it's right there in the manual (Concepts manual. If we had no thumbs. index blocks often fit 100 or more rows. That's it. we are just reading the first name on each page. clusters . Cluster indexes. user_indexes.blevel is the number of branch levels. In reality. To find the name Gallileo in this b-Tree phone book. which is a leaf block. we find Gallileo's address and phone number. I think I'll index some of the columns and see if it improves. Read page 350." I should have copyrighted it because I've seen it used so many times in the last 10 years. which consist of a name (indexed column value) and an address (ROWID) that tells you the physical location of the telephone (row in the table).or page for Microsoft boffins . you will always read the entire block and ignore the rows you don't need. The block size is configurable for any given database but is usually one of 4Kb. When we flick through the phone book. but here's the Cliff Notes version. and the pages .contain a complete sorted list of every name and address A sorted list in a phone book is fine for humans. insatiably curious. it needs to read the entire block. b-Tree is the "normal" index. and so on until we are left with a single page: the root of the tree. function-based indexes.
Staggeringly.SELECT object_id FROM WHERE AND user_objects object_type = 'INDEX' object_name = upper('&index_name').822 ----. When a leaf block is full. which means an entry for the new block must be added to the parent branch-block. "B" is for.. Try it on paper for yourself! How are Indexes used? Indexes have three main uses: o To quickly find specific rows by avoiding a Full Table Scan .the file name will contain your index name.. on the Oracle server. ALTER SESSION SET TRACEFILE_IDENTIFIER = "". Contrary to popular belief. As you insert new rows into the table. Here is a sample: *** 2007-01-31 11:51:26. new rows are inserted into index leaf blocks. another insert will cause the block to be split into two blocks. Now.. go to the directory shown by the final SHOW PARAMETER user_dump_dest command and find your trace file . . leaf: 0x68069cf 109078991 (320: nrow: 763 rrow: 763) leaf: 0x68069d0 109078992 (321: nrow: 761 rrow: 761) leaf: 0x68069d1 109078993 (322: nrow: 798 rrow: 798) leaf: 0x68069d2 109078994 (323: nrow: 807 rrow: 807) ----. The process propagates back up the tree until the parent of split has space for one more entry.. it too is split. this process ensures that every branch will be the same length.. A new root is created if the root node splits.begin tree dump branch: 0x68066c8 109078216 (0: nrow: 325.end tree dump This index has only a root branch with 323 leaf nodes. SHOW PARAMETER user_dump_dest Give the name of an index on a smallish table (because this will create a BIG file). Each leaf node contains a variable number of index entries up to 807! A deeper index would be more interesting. it's balanced. b is not for binary. level: 1) leaf: 0x68066c9 109078217 (-1: nrow: 694 rrow: 694) leaf: 0x68066ca 109078218 (0: nrow: 693 rrow: 693) leaf: 0x68066cb 109078219 (1: nrow: 693 rrow: 693) leaf: 0x68066cc 109078220 (2: nrow: 693 rrow: 693) leaf: 0x68066cd 109078221 (3: nrow: 693 rrow: 693) .. but it would take a while to dump. ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME TREEDUMP LEVEL &object_id'. If the branch-block is also full. or the root is reached.
o To avoid a sort This one is not so well known. If the information is in the index. like an email address.access("SRC_SYS"='CDW') . 8. If a sort operation requires rows in the same order as the index. Oracle does the same thing. 3. 1. 18. Despite all of the instances listed above where a sort is performed. It is OK if the range covers many blocks. I have only seen three cases where a sort is actually avoided. sum(actl_expns_amt). 17. Using the phone book metaphor. A range scan will find the first row in the range using the same technique as the Unique Scan. 14. A sort operation is not necessary since the rows are returned in sorted order. Oracle may even perform a Fast Full Scan of an index that it cannot use in a Range or Unique scan just to avoid a table access. However if we wanted to know his date of birth. 5* group by src_sys ------------------------------------------------------------| Id | Operation | Name | ------------------------------------------------------------| | |* |* 0 | SELECT STATEMENT 1 | 2 | 3 | SORT GROUP BY NOSORT | | | | TABLE ACCESS BY GLOBAL INDEX ROWID| EF_ACTL_EXPNS | INDEX RANGE SCAN | EF_AEXP_PK | ------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 . 19. Oracle performs a sort for many reasons: ORDER BY. o To avoid a table access altogether If all we wanted to do when looking up Gallileo in the phone book was to find his address or phone number. This takes time. 6. 16. largely because it is so poorly documented (and in many cases. DISTINCT. or all of the names alphabetically between "Smith" and "Smythe". uncorrelated IN-subqueries. unpredicatably implemented by the Optimizer as well). but because they save a table access. It is a reasonably common technique to add columns to an index. it's not hard to understand how a Range Scan works in much the same way to find all people named "Gallileo". we'd have to phone and ask. 7. 10. Analytic Functions). <. or BETWEEN in a WHERE clause. we could save time by adding it to the phone book. 4. If it was something that we needed all the time.We've already seen above how a Unique Scan works. 9. Range Scans can occur when we use >. Sort-Merge Joins. UNION). 12. but will then keep reading the index up to the end of the range. GROUP BY 1 2 3 4 select src_sys. 15. count(*) from ef_actl_expns where src_sys = 'CDW' and actl_expns_amt > 0 2. not because they will be used as part of the index scan. 20. 5.filter("ACTL_EXPNS_AMT">0) 3 . LIKE. GROUP BY. then Oracle may read the table rows via the index. then it doesn't bother to read the table. Set operations (eg. 13. In fact. 11. the job would be done.
31. 39. 40.filter("ACTL_EXPNS_AMT">0) 2 . 24. 28. 37. 35. 36. 34. 33. 26. ORDER BY 1 2 3 4 select * from ef_actl_expns where src_sys = 'CDW' and actl_expns_amt > 0 22. 21. Compare this to the following: 1 2 3 4 select * from ef_actl_expns where src_sys = 'CDW' and actl_expns_amt > 0 5* order by actl_expns_amt ------------------------------------------------------------| Id | Operation | Name | ------------------------------------------------------------| | |* 0 | SELECT STATEMENT 1 | 2 | SORT ORDER BY | | | | TABLE ACCESS BY GLOBAL INDEX ROWID| EF_ACTL_EXPNS | . 32. 27. 5* order by src_sys -----------------------------------------------------------| Id | Operation | Name | -----------------------------------------------------------| |* |* 0 | SELECT STATEMENT 1 | 2 | | | TABLE ACCESS BY GLOBAL INDEX ROWID| EF_ACTL_EXPNS | INDEX RANGE SCAN | EF_AEXP_PK | ------------------------------------------------------------ Predicate Information (identified by operation id): --------------------------------------------------- 1 . 30.Note the NOSORT qualifier in Step 1. 38. 23. 25. despite the ORDER BY clause.access("SRC_SYS"='CDW') Note that there is no SORT operation. 29.
4* and actl_expns_amt > 0 ------------------------------------------------------------| Id | Operation | Name | ------------------------------------------------------------| | |* |* 0 | SELECT STATEMENT 1 | 2 | 3 | SORT UNIQUE NOSORT | | | | TABLE ACCESS BY GLOBAL INDEX ROWID| EF_ACTL_EXPNS | INDEX RANGE SCAN | EF_AEXP_PK | ------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 . A SQL with a DISTINCT. 54. 59. This can be the difference between sub-second response time and several minutes or hours. 46. 58. 44. GROUP BY.filter("ACTL_EXPNS_AMT">0) 3 . This is an extraordinary tuning technique in OLTP systems like SQL*Forms that return one page of detail at a time to the screen. 48.|* 3 | INDEX RANGE SCAN | EF_AEXP_PK | ------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 .filter("ACTL_EXPNS_AMT">0) 3 .access("SRC_SYS"='CDW') 41. or worse: they make a query slower. sometimes indexes are no help at all. 55. or ORDER BY that uses an index to sort can return just the first page of matching rows without having to fetch the entire result set for a sort. we've seen how indexes can be good. 53. It's not always the case. 51. 47. 52. Everybody repeat after me: "Full table Scans are not bad" Up to now. 57. note the NOSORT qualifier. 50. 45. DISTINCT 1 2 3 select distinct src_sys from ef_actl_expns where src_sys = 'CDW' 42.access("SRC_SYS"='CDW') Again. . 43. 56. 49.
accessing the entire index and the entire table is still more IO than just accessing the table. the index. once again. As the number rises. Imagine a large deciduous tree in your front yard. There are a number of ways to influence index usage. These are particularly common in batch systems that process large quantities of data. functions (inc. we need a new metaphor. The db_file_multiblock_read_count setting described earlier means FTS requires fewer visits to the physical disk. the fastest way to do this (without a rake. selecting rows in no particular order. Regards. the database settings. an index scan just won't help. and A b-Tree index will be no help at all in a reduced scan unless the or casting that are outside the scope of this article. it is generally quicker to scan the index even for 100% of the rows. the entire block must be read with all but one row discarded. you decide to pick up the leaves in order of size.are the cases where an index makes a SQL slower. This is absolutely fantastic demonstration of the working of indexes in oracle. IN. caveats. you should check to make sure Oracle is not already using an index. except that they are nearest to hand. Hi Ross. It is very simple to understand. OR predicates. they work in an entirely predictable and even intuitive way. sub-queries. full credit to your way of detailing. NOT LIKE. Ingenious. A b-Tree index cannot be used to scan for any NOT style operators: eg. LIKE.and important . and it's your job to pick up all of the leaves on the lawn. Not only should you not bother creating or investigating the existence of an index. but this is clearly going to take a lot longer than a full table scan because you cover much more distance walking from leaf to leaf. reading a table in indexed order means more movement for the disk head. but a FTS might read 100 rows in a single block.. a number beyond which it is faster to just full table scan. or a leaf-vac. and complexities regarding joins. yes. generally it is somewhere between 1% and 10% of the table. NOT IN. This number varies depending on the table. stuffing leaves in the bag as you go. To read a row via an index. Oracle cannot read single rows. you take a digital photograph of the lawn..WHERE clause compares indexed columns using >. In support of this endeavour. So an index scan of 100 rows would read 100 blocks. Type this in SQL*Plus: SHOW PARAMETER db_file_multiblock_read_count Just to shake things up a bit (and to feed an undiagnosed obsessive compulsive disorder). The main reasons for this are: o o o o As implied above. If Oracle does not have to access the table then there is no breakeven point. Clearly. » y rleishman's blog y Login to post comments Fantastic article Submitted by sethunathu on Mon.. we approach a break-even point. This is a Full Table Scan. so embrace the technology and read the manual. So what's the lesson here? Know your data! If your query needs 50% of the rows in the table to resolve your query. There are lots of conditions. 2009-07-06 22:47. But just as obvious is that the index (virtual reality headset) is the faster way to pick up just the smallest leaf. It's Autumn. Oracle caches the next few blocks with the expectation that it will be asked for them very soon. not one by one. This metaphor works on a couple of levels: you would grab leaves in handfuls. Summary Indexes are not a dark-art. Consult a good SQL tuning manual. and the load on the server. A Full Table Scan does the same thing: when a bock is read from disk. Sethu . write an image analysis program to identify and measure every leaf. Understanding how they work moves Performance Tuning from the realm of guesswork to that of science. Much more interesting . BETWEEN operators. or even the 100 smallest leaves. !=. The exception to this rule . So obviously Full Table Scan is the faster way to pick up every leaf. consult a tuning manual.) would be get down on hands and knees with a bag and work your way back and forth over the lawn.there's always one is when all of the columns referenced in the SQL are contained in the index. To explain the problem. the hardware. then load the results into a Virtual Reality headset that will highlight the smallest leaf left on the lawn. arithmetic and concatenation). <. Even if none of these things was true.
» y Login to post comments You're awesome Submitted by atomikrej on Mon. Please keep posting such good articles. Thanks for the article. Appreciate your work. » y Login to post comments . 2010-06-13 01:25. After reading this I removed unnecessary indexes on some columns and my query runs much faster! » y Login to post comments good work Submitted by ultgnp on Sun. it was very helpful. 2009-12-07 18:34. One of the best article I've read on indexes.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.