Is this a proper query to add an Index?

If you are talking about adding it to a non-production version of SQL Server and then monitoring it under a workload, then yes.
Database Engine Tuning Advisor is good for analyzing the efficiency of the indexes.
One of the biggest concerns with recommended missing indexes is that it will suggest redundant indexes. For example, there could already be an index on PatientID and [EligibilitySegISA_DateImported] and rather creating this new index, you could simply modify the existing one to add the included column. That's one thing you have to watch for as the missing index recommendations does check for that sort of thing.

Here is the Missing Index Query, showing which Indexes should be added:
http://i.imgur.com/WbgTopg.png
Is this the correct Syntax to ad the Index?
create nonclustered index XX_INDEXNAME_XX
on [TopsData].[dbo].[BILL_EligibilitySegISA]
PatientID,
[EligibilitySegISA_DateImported]
include
[EligibilitySegISA_ISA13]
This topic first appeared in the Spiceworks Community

Similar Messages

  • Problem loading Query Designer Add-in

    Hi All,
    Can anyone please help me on my below issue.
    Whenever user is trying to start a new query in Essbase , he is getting below error message. It will not allow user to build a fresh Essbase pull
    Problem loading Query Designer Add-in. Workbook Activate,open & close operations may not be fully propogated
    Thanks in advance.
    Regards
    Vishal

    Hi Vishal,
    1) Try to remove the addin and then add again.(Before doing this close all the excel process from the task Manager)
    2) Check weather essexcln.xll and essxleqd.xla are corrupted.

  • Please help me with the proper query for the below problem

    Hi,
    I have a table RATE which have two columns RT_DATE (date) and RATES(number).
    This table have following data.
    RT_DATE
    RATES
    1-JAN-2007
    7
    2-MAR-2008
    7.25
    5-JAN-2009
    8
    8-NOV-2009
    8.5
    9-JUN-2010
    9
    I wanted to get the rate of interest on 8-DEC-2009.
    Output will be 8.5 as this given date is in between 8-NOV-2009 and 9-JUN-2010. Could you please help me with proper query?
    Regards,
    Aparna S

    Hi,
    That sounds like a job for the LAST function:
    SELECT  MIN (rates) KEEP (DENSE_RANK LAST ORDER BY rt_date) AS eff_rate
    FROM    rate
    WHERE   rt_date < 1 + DATE '2009-12-08'
    MIN above means that, in case of a tie (that is, 2 or more rows with the exact same latest rt_date) the lowest rates from that latest rt_date will be returned.  In rt_date is unique, then it doesn't matter if you use MIN or MAX, but syntax demands that you use some aggregate function there.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for your sample data, and also post the results you want from that data.
    Point out where the statement above is getting the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002#9362002

  • Query to add a column in between existing cols of a table?

    HI All,
    I have two questions.
    1. Query to add a column in between existing cols of a table? (not at the end. This is view of an order of output fields in a report)
    2. How do I swap the contents of two columns in a table. Suppose in a table tab there are 2 cols , col1,col2 populated with some data.
    I need a query(probably) to swap the col1 and col2 values . NOT AS A RESULT SET, BUT IT NEEDS TO GET CHANGED IN THE TABLE.
    Please help !

    > 1. Query to add a column in between existing cols of
    a table? (not at the end. This is view of an order of
    output fields in a report)
    Not really sensible ito DBMS - it does not care how you want to view the data. The sequence and formats of columns are what you/the application need to specify in the SQL's projection clause.
    Also keep in mind to achieve this, the DBMS will need to rewrite the entire table to fit this new column in-between existing columns. This is not the best of ideas.
    The projection of rows is dealt with SQL statements - not with the physical storage implementation.
    > 2. How do I swap the contents of two columns in a
    table. Suppose in a table tab there are 2 cols ,
    col1,col2 populated with some data.
    I need a query(probably) to swap the col1 and col2
    values . NOT AS A RESULT SET, BUT IT NEEDS TO GET
    CHANGED IN THE TABLE.
    This seems to work:
    SQL> create table foo_tab( c1 varchar2(10), c2 varchar2(10) );
    Table created.
    SQL> insert into foo_tab select TO_CHAR(rownum), TO_CHAR(object_id) from user_objects where rownum < 11;
    10 rows created.
    SQL> commit;
    Commit complete.
    SQL> select * from foo_tab;
    C1 C2
    1 55816
    2 55817
    3 55818
    4 55721
    5 105357
    6 105358
    7 105359
    8 105360
    9 105361
    10 60222
    10 rows selected.
    SQL> update foo_tab set c1=c2, c2=c1;
    10 rows updated.
    SQL> select * from foo_tab;
    C1 C2
    55816 1
    55817 2
    55818 3
    55721 4
    105357 5
    105358 6
    105359 7
    105360 8
    105361 9
    60222 10
    10 rows selected.
    SQL>

  • How to Perform this calculaction in Query

    Hi Experts
    How can i achieve this Calculaction at query Level.
    Data:
    Emp_ID--Wage_IDPayroll_Date--Amount
    1--03925.01.2008-5000
    1--03925.02.2008-5000
    1--03925.03.2008-5000
    1--03925.04.2008-6000
    1--03925.07.2008-6000
    The employee will have No of different Wage types in his pay run.
    But as per my requirment i want to calculacte Employee Salarly.
    Lets Consider Wage Type 039 which is Salarly
    The Cal i need to perform is
    Select the Wage Type 039 and then Select the Latest (25.07.2008) Payroll date and then select the amount assiociated with it for and the 12* amount give salarly
    In the above case aslarly should be 72,000

    Hi,
    Soluition can be the following:
    Put Pay_Roll_date also as a key-figure in your cube and add to columns.
    Add condition (top 1) on keyfigure,
    In Character Assignment tick ïndividual char. and Char combinations.
    Tick also Emp_id and Wage ID. do not tick Pay_Roll_date (the characteristics, not the keyfigure)
    Hide key-figure Pay_roll_date & Amount
    Make calculated keyfigure Salary = 12 * Amount.
    That should do it.
    Udo

  • Query to add responsibility to multiple Users.

    Hi All,
    I need a query to add a newly created RESPONSIBILITY to multiple Oracle Apps Users (>1000) through sql query , not through Data Loader. Any help in this regard will be highly appreciated.
    Please list out the tables on which the INSERT (or other) statement need to be performed for acheiving the above mentioned purpose.
    Regards,
    Imran

    Hi,
    I believe you need to read the list of username from FND_USER table and write a script to add this new responsibility for each user.
    How to use FND_USER_PKG.AddResp
    Re: How to use FND_USER_PKG.AddResp
    Regards,
    Hussein

  • Can I refactor this query to use an index more efficiently?

    I have a members table with fields such as id, last name, first name, address, join date, etc.
    I have a unique index defined on (last_name, join_date, id).
    This query will use the index for a range scan, no sort required since the index will be in order for that range ('Smith'):
    SELECT members.*
            FROM members
            WHERE last_name = 'Smith'
            ORDER BY joindate, idIs there any way I can get something like the following to use the index (with no sort) as well:
    SELECT members.*
            FROM members
            WHERE last_name like 'S%'
            ORDER BY joindate, idI understand the difficulty is probably; even if it does a range scan on every last name 'S%' (assuming it can?), they're not necessarily in order. Case in point:
    Last_Name:  JoinDate:
    Smith          2/5/2010
    Smuckers     1/10/2010An index range scan of 'S%' would return them in the above order, which is not ordered by joindate.
    So is there any way I can refactor this (query or index) such that the index can be range scanned (using LIKE 'x%') and return rows in the correct order without performing a sort? Or is that simply not possible?

    xaeryan wrote:
    I have a members table with fields such as id, last name, first name, address, join date, etc.
    I have a unique index defined on (last_name, join_date, id).
    This query will use the index for a range scan, no sort required since the index will be in order for that range ('Smith'):
    SELECT members.*
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindate, idIs there any way I can get something like the following to use the index (with no sort) as well:
    SELECT members.*
    FROM members
    WHERE last_name like 'S%'
    ORDER BY joindate, idI understand the difficulty is probably; even if it does a range scan on every last name 'S%' (assuming it can?), they're not necessarily in order. Case in point:
    Last_Name:  JoinDate:
    Smith          2/5/2010
    Smuckers     1/10/2010An index range scan of 'S%' would return them in the above order, which is not ordered by joindate.
    So is there any way I can refactor this (query or index) such that the index can be range scanned (using LIKE 'x%') and return rows in the correct order without performing a sort? Or is that simply not possible?Come on. Index column order does matter. "LIKE 'x%'" actually is full table scan. The db engine accesses contiguous index entries and then uses the ROWID values in the index to retrieve the table rows.

  • My computer crashed. So does this mean I can not add any more music to my ipod from a different computer without all the songs being erased? Can I sync my ipod to a new computer if I allow all the songs to be erased?

    My computer crashed. So does this mean I can not add any more music to my ipod from a different computer without all the songs being erased? The ipod works fine and now i got a new computer. So it seems like my only options are leaving my ipod in a state where i cant add anymore songs or erasing all my songs and trying to use my ipod from my new computer. Can someone please inform me on how to have my ipod work from a different computer, even if i have to erase my songs. Thanks.

    Yes, if you choose the Erase and Sync option (or restore your iPod) you will be allowed to sync your iPod with the new computer.
    If you would like to save the content that's currently on your iPod, see this older thread from another forum member Zevoneer discussing the different ways to copy the content on an iPod back to your PC.
    https://discussions.apple.com/thread/2417169?start=0&tstart=0
    B-rock

  • I have an iPad 2 with iOS 5.1 and iBooks version 2.1.1. I have 64GB of storage, 80% is used. iBooks is using 250MB of storage. I have a large number of PDF files in my iBooks library. At this time I can not add another book or PDF file to my library.

    I have an iPad 2 with iOS 5.1 and iBooks version 2.1.1. I have 64GB of storage, 80% is used. iBooks is using 250MB of storage. I have a large number of PDF files in my iBooks library. At this time I can not add another book or PDF file to my library.  When I try to move a PDF file to iBooks the system works for a while...sometimes the file appears and than disappears....sometimes the file never appears. Is ther some limit to the number of books or total storage used in IBooks?  Thanks....

    Hi jybravo70, 
    Welcome to the Apple Support Communities!
    It sounds like you may be experiencing issues on your non iOS 8 devices because iOS 8 is required to set up or join a Family Sharing group.
    The following information is located in the print at the bottom of the article. 
    Apple - iCloud - Family Sharing
    Family Sharing requires a personal Apple ID signed in to iCloud and iTunes. Music, movies, TV shows, and books can be downloaded on up to 10 devices per account, five of which can be computers. iOS 8 and OS X Yosemite are required to set up or join a Family Sharing group and are recommended for full functionality. Not all content is eligible for Family Sharing.
    Have a great day, 
    Joe

  • Why is this query not using the index?

    check out this query:-
    SELECT CUST_PO_NUMBER, HEADER_ID, ORDER_TYPE, PO_DATE
    FROM TABLE1
    WHERE STATUS = 'N'
    and here's the explain plan:-
    1     
    2     -------------------------------------------------------------------------------------
    3     | Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
    4     -------------------------------------------------------------------------------------
    5     | 0 | SELECT STATEMENT | | 2735K| 140M| 81036 (2)|
    6     |* 1 | TABLE ACCESS FULL| TABLE1 | 2735K| 140M| 81036 (2)|
    7     -------------------------------------------------------------------------------------
    8     
    9     Predicate Information (identified by operation id):
    10     ---------------------------------------------------
    11     
    12     1 - filter("STATUS"='N')
    There is already an index on this column, as is shown below:-
         INDEX_NAME INDEX_TYPE     UNIQUENESS     TABLE_NAME     COLUMN_NAME     COLUMN_POSITION
    1     TABLE1_IDX2 NORMAL     NONUNIQUE     TABLE1      STATUS     1
    2     TABLE1_IDX NORMAL     NONUNIQUE     TABLE1     HEADER_ID     1
    So why is this query not using the index on the 'STATUS' Column?
    I've already tried using optimizer hints and regathering the stats on the table, but the execution plan still remains the same, i.e. it still uses a FTS.
    I have tried this command also:-
    exec dbms_stats.gather_table_stats('GECS','GEPS_CS_SALES_ORDER_HEADER',method_opt=>'for all indexed columns size auto',cascade=>true,degree=>4);
    inspite of this, the query is still using a full table scan.
    The table has around 55 Lakh records, across 60 columns. And because of the FTS, the query is taking a long time to execute. How do i make it use the index?
    Please help.
    Edited by: user10047779 on Mar 16, 2010 6:55 AM

    If the cardinality is really as skewed as that, you may want to look at putting a histogram on the column (sounds like it would be in order, and that you don't have one).
    create table skewed_a_lot
    as
       select
          case when mod(level, 1000) = 0 then 'N' else 'Y' end as Flag,
          level as col1
       from dual connect by level <= 1000000;
    create index skewed_a_lot_i01 on skewed_a_lot (flag);
    exec dbms_stats.gather_table_stats(user, 'SKEWED_A_LOT', cascade => true, method_opt => 'for all indexed columns size auto');Is an example.

  • Is this a proper way to check if a string exist in a db-column?

    I don't know I am posting this in the right forum... anyway... I am trying to check if a string as an email address exist in a database with jsp (by returning true if the string exist). I have managed to do it but I am not sure if this is the best way.
    As you see I have used stmt.executeQuery( "SELECT myDbColumn FROM myTable where myDbColumn=myInputStr" ) and checked by if rs.next() returning false or true. Here is my code in short format:
    boolean strExist = false;
    String myInputStr = request.getParameter("inputStr");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery( "SELECT myDbColumn FROM myTable where myDbColumn=myInputStr" );
       if(rs.next())
          strExist = true;
       else
          strExist = false;
        return strExist;Is this the proper way of checking if a string exist in a db-column???
    Thanks

    I responded to your first thread [here.|http://forums.sun.com/thread.jspa?threadID=5374902]

  • Is this a proper way  of looking in a db-column?

    I am trying to check if a string as an email address exist in a database with jsp (by returning true if the string exist). I have managed to do it but I am not sure if this is the best way.
    As you see I have used stmt.executeQuery( "SELECT myDbColumn FROM myTable where myDbColumn=myInputStr" ) and checked by if rs.next() returning false or true. Here is my code in short format:
    boolean strExist = false;
    String myInputStr = request.getParameter("inputStr");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery( "SELECT myDbColumn FROM myTable where myDbColumn=myInputStr" );
       if(rs.next())
          strExist = true;
       else
          strExist = false;
        return strExist;Is this the proper way of checking if a string exist in a db-column???
    Thanks

    PreparedStatement is indeed the way to go.
    Regarding to your code logic: this boolean strExist is less or more superfluous.
    Leave it away and just doreturn rs.next();Or if you really, really need it then just dostrExist = rs.next();That said, do you properly close all resources? I see that you're immediately leaving the method block, leaving the statement and the resultset unclosed behind. This is resource leaking. The longer your application runs, the more you do so, your application will crash due to a shortage of DB resources. You need to close all the resources (connection, statement and resultset) as soon as possible. Do it in the finally block of the try block around SQLException in the same method.
    I suggest to go through this tutorial to get some useful and proper ideas of how the database access stuff ought to be done: [http://balusc.blogspot.com/2008/07/dao-tutorial-data-layer.html]. Good luck.

  • HT1347 from this site how i can add software to iphone

    from this site how i can add software to iphone

    From what site?
    You can only get apps/softare from the app store in itunes.

  • You need to allow flash to make this a proper device. When will you allow flash?

    You need to allow flash to make this a proper surfing device. When will you allow flash or listen to those buying your product?

    This is a user-to-user help forum. We are all users here. You are not talking to Apple.
    If you wish to tell Apple your ideas go to: http://www.apple.com/feedback/ipad.html
    Perhaps reading some of the thousands of posts in this forum about Flash would have told you this. Use the forum search feature to find these.

  • I have purchased adobe pdf pack so i can delete some text from my converted files, this will only let me add text but not delete any, please help

    i have purchased adobe pdf pack so i can delete some text from my converted files, this will only let me add text but not delete any, please help

    I tyhink that you need ExportPDF, Adobe ExportPDF (read only). In any case, thius may help: Cancel your membership or subscription | Acrobat.com online services

Maybe you are looking for

  • Vendor Trade Discounts in SAP

    We are using a scenario where Purchase Orders are getting created by Vehicle Management System. The material being purchased is split valuated & Batch managed ( i.e Valuation Category X ). The Purchase Order is created for a gross amount. say 100 USD

  • OSB 10.3 Security ip address

    Hello, I Have just started working with OSB 10.3 and need to add a filter for ip address for my web service. Can you help me? Does it design someone of since doing it? If one can, I would like to have a file where there are the ip address that have a

  • How to restore ipod touch back to new

    how do i restore my ipod back to new, I bought it of of my mother in law and i want to erase everything from email to credit card info?

  • Libreoffice Fail to Load

    Hey everyone, I just recently downloaded Libreoffice, and I'm trying to start the writer. Error when starting libreoffice: [Java framework] Error in function createSettingsDocument (elements.cxx). javaldx failed! Warning: failed to read path from jav

  • Analogue video recording software

    I'm currently using a canopus advc110 video card and quicktime pro as my recorder. Quicktime pro allows four different quality settings for the recording which is nice but not enough. I would like to have my computer processing the video I'm importin