Indexes

  • Hello,

    I have a table that contain 10 lakhs of data.

    when i tried to retrieve that data it takes lot of time.

    How to create indexes to that table to retrieve data as

    fast as ...

    ///*** SEND ME ANY GOOD LINKS FOR THAT ***///

    Thanks:

    Dastagiri.D

    Thanks
    Dastagiri.D

  • It depends on the table's definition and what queries you are using.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • hello,

    In my query are:

    1) select * from orders where ordered BETWEEN 100000 AND 300000.

    2)SELECT * from orders where ordered=300000

    Thanks
    Dastagiri.D

  • Well, it still depends on your table definition and data distributions, but:

    1) I doubt that you can do much with this one. Maybe a clustered index on [ordered], but it probably won't help too much.

    2) Any index on [ordered] will help this one immensely.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • dastagirid (10/22/2008)


    hello,

    In my query are:

    1) select * from orders where ordered BETWEEN 100000 AND 300000.

    2)SELECT * from orders where ordered=300000

    first thing never use asterisk(*) in the select query as it consumes more resources, specify the required column names.

    second, select the required column on which you want an index and use the following statement

    CREATE INDEX [IDX_UnitPrice] ON Products (UnitPrice)

    this is the normal syntax based on your requirement. but on 10 laksh it may take some time to perform.

    kshitij kumar
    kshitij@krayknot.com
    www.krayknot.com

  • hi,

    I attached one file.on that file one table is there .That table have 100000 records.

    When i used profiler and found duration time when execute that query.It takes 1584 mILLIseconds.

    any solution is there to apply indexes to that table and retrieve data as early.(not only that perticuler query ..i used on that table lot of queries to retrive data its also took 5 seconds and 7 seconds).

    second question?

    any solution is there to apply to increase the performance of that queries(using profiler).

    Thanks
    Dastagiri.D

  • If you don't have a clustered index on the table, I'd at least put one on that ID column. After that, take a look at the execution plans to determine if that index is appropriate or if you need other indexes.

    I agree with the statement above, * is a poor choice for the SELECT statement most of the time.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • dastagirid (10/23/2008)


    I attached one file.on that file one table is there .That table have 100000 records.

    When i used profiler and found duration time when execute that query.It takes 1584 mILLIseconds.

    any solution is there to apply to increase the performance of that queries(using profiler).

    For this one, put an index on bloodgroupid.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • dastagirid (10/22/2008)


    Hello,

    I have a table that contain 10 lakhs of data.

    when i tried to retrieve that data it takes lot of time.

    How to create indexes to that table to retrieve data as

    fast as ...

    ///*** SEND ME ANY GOOD LINKS FOR THAT ***///

    Thanks:

    Dastagiri.D

    Make sure that whatever RND you will do, that must be on the testing dB otherwise you can find yourself in trouble

    kshitij kumar
    kshitij@krayknot.com
    www.krayknot.com

  • what's a lakhs?

    potato pancake?

    bodies of water?

    is missing and really needs?

  • Funny, I was wondering the same thing. I even did a google search to try to track it down.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • As I recall, a Lakh is 100,000.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • And is that a language term or a mathematic/engineering term?

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • its an indian language term, used as a unit of measurement. Means quite a big amount, cannot remember how much, barry might be right

    1 lakh = quite a lot really

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

  • A lakh (also written lac) is a unit in the Indian numbering system equal to one hundred thousand (100,000; 105). It is widely used both in official and other contexts in Bangladesh, India, Nepal, Sri Lanka, Myanmar and Pakistan, and is often used in Indian English.

    Exact pronunciation varies in different South Asian languages. In Hindi it is (IPA) [la:k?], in British English [lak] (homophone with British "lack") or [l?:k] (homophone with British "lark"), and in American English [l?k] (homophone with American "lock"). In English the word is used both as an attributive and non-attributive noun, and with either a marked ("-s") or unmarked plural: "1 lakh people" or "1 lakh of people", "5 lakh rupees", "5 lakh of rupees", "5 lakhs rupees", "5 lakhs of rupees" are all to be found.

    The Indian numbering system also uses separators differently than the Western system — after the first three digits, a comma divides every two rather than every three digits, thus:

    * Indian system: 12,12,12,123 5,05,000 7,00,00,00,000.

    * are the same quantities as Western system: 121,212,123 505,000 7,000,000,000

    This accords with the Indian naming system, which has units for thousand, hundred thousand, ten million, etc.

    source

    http://en.wikipedia.org/wiki/Lakh

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic. Login to reply