Best index for Between operator

I have a table abc where create_date column with date datatype.
My table abc is having one million row,
my query is some thing like
select * from abc
where create_Date between :low_date and :high_date;
Ideally if I use the same query in my report it is taking 15 hrs for one month of data and in normal case it is doing Full Table Scan of abc.
So I want to create an index, Please let me know what type of index will give me the performance improvement. (expected 4 to 5 hours).

Alex wrote:
Hi,
Create a NON-Unique Bitmap Index for create_Date column.
CREATE INDEX Your_Index_Name ON Your_table_Name
(create_Date )
LOGGING
PARALLEL ( DEGREE Default INSTANCES Default );Even you ahve 1 million records, 15 hours is too far from the normal situation.
So ones after you create teh index check the report again.
if it takes more time then execute the same query in sql plus or any other sql interface and see how long it takes to retrive all details.
Sometimes this slowness can caused by the report you use. Not exactly from the sql query.Probably not a great idea since we have no idea what this table is, how it's loaded, if it's transactional or data-warehouse oriented.
Your "solution" could well cause a myriad of performance problems outside of the OP's original query. And it will almost certainly not be the solution to their problem. As i stated in my post, and you have also mentioned ... 15 hours to read 1 million rows is indicative of a serious problem, no single index is going to fix that.

Similar Messages

  • Weblink syntax for 'between' operator

    I have created a weblink that works fine with the gt and eq operator but I would like to use the 'bet' between operator. I tried entering the 2 values separated by a comma, semi-colon, surrounded with parenthesis, but I still get an error.
    What is the correct syntax to provide 2 dates for the P6 parameter. This is my weblink url:
    https://secure-ausomxbha.crmondemand.com/OnDemand/user/ReportIFrameView?SAWDetailViewURL=saw.dll?Go%26Path%3D%252fshared%252fCompany_31193_Shared_Folder%252fUnused%252fTemp&Action=Navigate&P0=2&P1=eq&P2=Lead.PICK_1&P3=Fans&P4=bet&P5=Lead.Created&P6=(08-30-09,09-30-09)

    According to Michael L's book the operator is 'bet'.
    I have already tried using what you have suggested. That is add an extra param and check for date less-than(lt) SELECTED_DATE and date greater-than(gt) SELECTED_DATE. That doesnt work either. CRMOD ignores the 2nd param and takes into account only the first one.
    *(I did not forget to change P0=3)
    Any other suggestions?
    Edited by: nmbtcAdmin on Nov 16, 2009 3:26 PM

  • Help me in creatin an index for inequality operator  =

    Hi Gurus,
    I created an index as below
    create index bu_eff_from_dt_indx on bu(eff_from_dt)
    When I got the execution plan as below for this query
    select * from bu
    where eff_from_dt = '01-MAR-2006'
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 217 | 28644 | 43 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| BU | 217 | 28644 | 43 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | BU_EFF_FROM_DT_INDX | 217 | | 1 (0)| 00:00:01 |
    The same is not working for <= operator.
    select * from bu
    where eff_from_dt <= '01-MAR-2006'
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 124K| 15M| 566 (3)| 00:00:07 |
    |* 1 | TABLE ACCESS FULL| BU | 124K| 15M| 566 (3)| 00:00:07 |
    The total records in this table is more than 2 lacs ..
    Please help me to resolve this issue either by index or by partition or any other ..

    An example:
    SQL> drop table test;
    Table dropped.
    SQL> create table test as select * from all_objects;
    Table created.
    SQL> select count(*) from test;
      COUNT(*)
          9304
    SQL> create index test_idx on test(object_id);
    Index created.
    SQL> analyze table test compute statistics;
    Table analyzed.
    SQL> set autotrace traceonly exp
    SQL> select * from test where object_id = 1542;
    Execution Plan
    Plan hash value: 1389866015
    | Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Ti
    me     |
    |   0 | SELECT STATEMENT            |          |     1 |    76 |     2   (0)| 00
    :00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEST     |     1 |    76 |     2   (0)| 00
    :00:01 |
    |*  2 |   INDEX RANGE SCAN | TEST_IDX |     1 |       |     1   (0)| 00
    :00:01 |
    Predicate Information (identified by operation id):
       2 - access("OBJECT_ID"=1542)
    SQL> select * from test where object_id < 1542;
    Execution Plan
    Plan hash value: 1389866015
    | Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Ti
    me     |
    |   0 | SELECT STATEMENT            |          |  1396 |   103K|    24   (0)| 00
    :00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEST     |  1396 |   103K|    24   (0)| 00
    :00:01 |
    |*  2 |   INDEX RANGE SCAN | TEST_IDX |  1396 |       |     4   (0)| 00
    :00:01 |
    Predicate Information (identified by operation id):
       2 - access("OBJECT_ID"<1542)
    SQL> select * from test where object_id < 5000;
    Execution Plan
    Plan hash value: 1357081020
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |  4529 |   336K|    36   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| TEST |  4529 |   336K|    36   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("OBJECT_ID"<5000)
    SQL>

  • Netgear Stora, what is the best configuration for smooth operation

    I have a Netgear stora, and I know how to configure the best possible way this system for Mac NAS. It always gives me problems and the NAS system invites me to visit the Apple community.
    In Windows XP system and Windows 7 works correctly.
    Can you help please, I do not know if you need another type of program, or if my mac must have a particular program to work or any particular update, since this update to version 10.7.4.
    Thank you very much.

    thanks Rick
    what about the differences in the two processor
    options.
    is there really a noticeable difference?
    thanks
    niko
    I seriously doubt that there would be. My 2.16Ghz iMac is plenty fast and I doubt that most people would be able to tell the difference between it and the 2.33. By FAR the most important upgrade is RAM. Don't get the extra RAM from Apple though -- it's too expensive and the RAM is easily upgradeable. Buy it from Crucial and install it yourself. I got 2 gigs from them for $85 plus shipping. Just remember, there are only 2 RAM slots so if you want to max it out at 3 gigs you will have to get a 2 gig stick and a 1 gig.

  • Best index for big association table

    Hi,
    I have an association table:
    SURROGATE_ID, CONTENT_TYPE, OWNER_ID, REF_COUNT
    The SURROGATE_ID is an auto generated primary key.
    There are about 5 different content type integers.
    There are a huge number of OWNER_ID long integers, including a value of NOBODY_ID.
    The refcount reflects the number of contents for that type with that owner.
    I need a fast COUNT(*) query that for a given CONTENT_TYPE value, and a given OWNER_ID value, counts the number of rows (either zero or one) with REF_COUNT > 0.
    My naive ploy would be orthogonal indices on CONTENT_TYPE, OWNER_ID, and REF_COUNT.
    And then construct a reasonable query not worrying about the order of the conditions:
    where CONTENT_TYPE = :mytype and OWNER_ID = :myowner and REF_COUNT > 0
    Can someone tell me the wisest index to use?
    Andy

    user9990110 wrote:
    Hi,
    I have an association table:
    SURROGATE_ID, CONTENT_TYPE, OWNER_ID, REF_COUNT
    The SURROGATE_ID is an auto generated primary key.
    There are about 5 different content type integers.
    There are a huge number of OWNER_ID long integers, including a value of NOBODY_ID.
    The refcount reflects the number of contents for that type with that owner.
    I need a fast COUNT(*) query that for a given CONTENT_TYPE value, and a given OWNER_ID value, counts the number of rows (either zero or one) with REF_COUNT > 0.Define fast please.
    user9990110 wrote:
    My naive ploy would be orthogonal indices on CONTENT_TYPE, OWNER_ID, and REF_COUNT.I'm not sure i understand your use of the word orthogonal in this context, can you elaborate please?
    user9990110 wrote:
    And then construct a reasonable query not worrying about the order of the conditions:
    where CONTENT_TYPE = :mytype and OWNER_ID = :myowner and REF_COUNT > 0
    Can someone tell me the wisest index to use?
    AndyDon't worry about the order of the conditions in your SQL, the cost based optimizer will handle that for you based on a plethora of factors.
    Are you always going to query by content_type, owner_id and ref_count? How many other columns does this table have? You say 'big', but are you talking row wise, column wise, both?
    My first instinct would be to index (in this order, and assuming this table has many other columns):
    CONTENT_TYPE
    OWNER_ID
    REF_COUNT

  • How to use BETWEEN Operator in physical layer in OBIEE 11g

    Hi Experts,
    How do I do the BETWEEN Operator functionality in Physical layer if my requirements is like this?
    TABLE_1.COLUMN_1 = TABLE_2 is between COLUMN_2 and COLUMN_3
    Below is the syntax for BETWEEN Operator function when I am trying to insert them.
    <<expression>> BETWEEN <<Upper Bound>> AND <<Lower Bound>>
    Thanks,
    Edited by: OBIEE/BIP Forumer on Nov 3, 2012 11:37 PM

    Below is an example diagram, as you can see, FACT TABLE have a join (an arrow one) towards TABLE_1 and TABLE_3. AS for the TABLE_3, this table is the one which I implement with the BETWEEN Operators function in Physical Layer. Also, the arrow in FACT TABLE and TABLE_3 is a red one with no arrow head line.
    TABLE_2
    ^
    l
    l
    l
    FACT TABLE ---------> TABLE_1
    l
    l
    l
    TABLE_3
    Edited by: OBIEE/BIP Forumer on Nov 4, 2012 2:33 AM

  • Best practice for PK and indexes?

    Dear All,
    What is the best practice for making Primary Key and indexes? Should we keep them in the same tablespace as table or should we create a seperate tableapce for all indexes and Primary Key? Please note I am talking about a table that has 21milion rows at the moment and increasing 10k to 20k rows daily. This table is also heavily involved in daily reports and causing slow performance. Currently the complete table with all associated objects such as indexes and PK is stored in one seperate tablespace. If my way is right then please advise me how can I improve the performance of retrival or DML operation on this table?
    Thanks in advance..
    Zia Shareef

    Well, thanks for valueable advices... I am using Oracle 8i and let me tell you exact problem...
    My billing database has two major tables having almost 21 millions rows each... one has collection data and other one for invoices... many reports are showing the data with the joining of Customer + Collection + Invoices tables.
    There are 5 common fields in between invoices(reading) and collection tables
    YEAR, MONTH, AREA_CODE, CONS_CODE, BILL_TYPE(adtl)
    My one of batch process has following update and it is VERY VERY SLOW:
    UPDATE reading r
    SET bamount (SELECT sum(camount)
    FROM collection cl
    WHERE r.ryear = cl.byear
    AND r.rmonth = cl.bmonth
    AND r.area_code = cl.area_code
    AND r.cons_code = cl.cons_code
    AND r.adtl = cl.adtl)
    WHERE area_code = 1
    tentatively area_code(1) is having 20,000 consumers
    each consuemr may have 72 invoices and against these invoices it may have 200 rows in collection tables (system have provision to record partial payment against one invoice)
    NOTE: Please note presently my process is based on cursors so the above query runs for one consumer at one time but just for giving an idea I have made it for whole area.
    Mr. Yingkuan, can you please tell me how can I check that the table' statistics is not current and how can I make it current. Is it really effect performance?

  • Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? Difference between Enterprise and SE?

    We’re seeing the following issue: sql - Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? - Stack Overflow (posted by a colleague of mine) and are curious to know if this behaviour is due to a difference between standard and enterprise, or could we doing something else wrong in our DB config.?
    We have also reproduced the issue on the following stacks:
    Oracle SE One 11.2.0.3 (with Spatial enabled)
    Redhat Linux 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
    11.2.0.3.0 Standard Edition and 11.2.0.4.0 Standard Edition (both with Spatial enabled)
    Microsoft Windows Server 2003R2 Standard x64 Edition
    However, the SQL works fine if we try it on Oracle 11.2.0.3.0 *Enterprise* Edition.
    Any help or advice would be much appreciated.
    Kindest Regards,
    Kevin

    In my experience sdo_filter ALWAYS uses the spatial index, so that's not the problem. Since you did not provide the explain plans, we can't say for sure but I think yhu is right: Standard Edition can't use the bitmap operations, and thus it'll take longer to combine the results of the two queries (because the optimizer will surely split this OR up in two parts, then combine them).
    BTW: when asking questions about queries here, it would be nice if you posted the queries here as well, so that we do not have to check another website in order to see what you are doing. Plus it will probably get you more answers, because not everyone can be bothered to click on that link. It would also have been nice if you had posted your own answer on the other post here as well, because my recommendation would have been to use union all - but since you already found that out for yourself my recommendation would have been a little late.

  • XML Document Format for JDBC Receiver(Between operation)

    Hello everybody,
    is there a way to use a BETWEEN operation for the key in a SELECT XML document format????????, I need to filter in the Where for different Statements in teh strcuture as BETWEEN, thanks in advance.
    Regards,
    Julio

    http://help.sap.com/saphelp_nw70/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    Not sure but Check the option of
    <key1>
         <col2 compareOperation=u201DLTu201D>val2old</col2>
         <col2 compareOperation=u201DGTu201D>val2old</col2>
    </key1>
    Thanks,
    Beena.

  • Between operator for group by date in Apex Interactive Reports

    Hi,
    In the interactive reports filter, i couldn't find the 'between' operator for date field (got a 'group by date' in my sql query (source). I am just wondering, Is it beacuse of the group by date clause?. Is there any way to show the 'between' operator in the interactive reports filter.
    Thanks

    I just opened an existing IR style report, went to actions, filter, selected a date column and found between at the bottom of the list of values.. Are you sure the date you are trying to filter on is a true date column?
    Thank you,
    Tony Miller
    Webster, TX
    What if you really were stalking a paranoid schizophrenic... Would they know?
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Noticing a lot of database index fragmentation yet no Health Analyzer alerts...? Best practice for database maintenance in 2013?

    Could someone point me to a document for best practices for database maintenance with SharePoint 2013? I have read the 2010 document, but I'm hoping their is an updated one that I'm just missing.
    My problem is that our DBA recently noticed that many of our SharePoint databases have high index fragmentation.  I have the Health Analyzer rules enabled for index fragmentation and they run daily, but I've never received an alert despite the majority
    of our databases having greater than 40% fragmentation and some are even above 95%.  
    Obviously it has our attention now and we want to get this addressed.  My understanding (which I now fear is at best incomplete, more likely just plain wrong) was that a maintenance plan wasn't needed for index fragmentation in 2010/2013 like it was
    in 2007. 
    Thanks,
    Troy

    It depends. Here are the rules for that job:
    Sampled mode
    Page count >24 and avg fragmentation in percent >5
    Or
    Page count >8 avg page space used in percent < fill_factor * 0.9 (Fill Factor in SharePoint 2013 varies from 80 to 100 depending on the index, it is important not to adjust index fill factors)
    I have seen cases where the indexes are not automatically managed by the rule and require a manual defragmentation with a Full Scan, instead of Sampled. Once the Full Scan defrag completed, the timer job started handling the index fragmentation automatically.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Best Method For Importing Clips Between FCP Projects

    What is the best method for importing clips between FCP 7.0.3 projects?  I am wondering whether or not pulling the clips from the Capture Scratch folder is the way to go or will using Import from the new FCP project create a new folder in Capture Scratch with the imported clips?  I have a new HD camcorder with different clips for different projects and Log and Transfer makes it so easy to bring them all in at once but now wondering how best to separate them into separate Capture Scratch folders for each project. 

    well, I simply either drag them in to the new/different project from the finder, or drag or copy and paste between open fcp projects.  Never had any problems working this way.  Just remember that if you delete a specific project scratch disk folder, you may be deleting media used in another project.

  • Between operator not appearing for date in custom field of IBASE search

    Hi experts
    I am using CRMCMP_IBSEARCH for search enhacement of IBASE by adding a new fields as valid from date in CRM 7.0.
    I have added the field using append structure in the search structure of IBASE.Now my requirement is i am unable to see the between operator in UI for this date field and also i cannot enter date range for my requirement.
    Any su

    Hi,
    please go to SM34 and open viewcluster CRMVC_DQ
    Check and change here the operators for your component and view / attribute.
    Kind regards
    Manfred

  • MMy iPhone 4s is struggling to send messages and dial out.. service is going back and forth between Verizon with a little circle, Roaming, and No Service.. Best fix for this problem..? Thanks

    My iPhone 4s is struggling to send messages and dial out.. Service is going back and forth between Verizon (with a little circle), Roaming, and No Service.. Best fix for the problem..?
    Thanks

    My iPhone 4s is struggling to send messages and dial out.. Service is going back and forth between Verizon (with a little circle), Roaming, and No Service.. Best fix for the problem..?
    Thanks

  • Best Index type for low variability columns like Country or LastName

    Hi, 
    What would be best Index to use on Low variability columns like Country or LastName in SQL Server.
    I think BitMap index we can use only on columns where we can have two possible value like male/female.

    basically I was trying to figure out if there is any kind of Indexes in SQL Server which have special design for low variability column. 
    my example queries like :  select a,b,c from table t where country = 'USA'
    Hi Eshant,
    In your scenario, you need to know which index is the best Index to use on Low variability columns like Country or LastName in SQL Server. As per my understanding, the performance not only related to the types of index on that column, but also related
    to the records on your table.
    Here is blog which tests the performance for different types of index on variability column like lastname, please refer to the link below.
    http://www.codeproject.com/Articles/234399/Database-performance-optimization-part-Indexing
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

Maybe you are looking for

  • Material identification by vendor or Manufacturer part number details??

    Dear Experts, I have a scenario where we create a material say A and available vendors X, Y and Z. Same material are called as AX, AY and AZ by vendors X, Y and Z respectively. But when we raise a Purchase Order and Print it I need to get the descrip

  • Question about logon screen customization

    Hi, I have to customize the web logon screen of the BEx. In SICF, on the BEx service, on the Error Pages tab, System logon is checked. If i click on the Setting button I have : Define Service-Specific Settings System ID Language System Messages Logon

  • What is the image resolution in the PDF file for an "Add Image"?

    I am using Acrobat Pro XI.  I added a 600 dpi image to my PDF file.  When I click on it and copy a chunk of it, then paste it into paint, the image resolution is 96 dpi.  How can I tell the resolution is of images in my PDF file?  I am trying to keep

  • Can anyone post an overview of the permissions of the server folder

    I saved the server data on an external drive. I accidently cut off the power source. All services had failures since then. So I thought I could repair it if I would just restore the whole system from the TM Backup from a time before the cut off. All

  • D0 is not this fstype after creating RAID 1 mirror

    Hi there, I'm trying to mirror the disks in my Sun Fire 280R following the instructions detailed on http://www.nbl.fi/~nbl97/raid1.html When it comes to doing the metaroot and rebooting the server then doesnt boot in to solaris 9 claiming: mount: d0