Results 1 to 5 of 5
  1. #1

    Default create index using substr


    possible ba nga maka create ko ug index using substr

    for example nakoi field nga num nga naai char( as the datatype and length.

    ang value sa num would look something like 09092010

    now, ganahan nako himuon nga index ang num nga field. pero ang gusto nako ang last 4 characters lang. bale ang ma index lang kai ang 2010.

    possible bana?

    thank you.

  2. #2
    Quote Originally Posted by c-chan View Post
    possible ba nga maka create ko ug index using substr

    for example nakoi field nga num nga naai char( as the datatype and length.

    ang value sa num would look something like 09092010

    now, ganahan nako himuon nga index ang num nga field. pero ang gusto nako ang last 4 characters lang. bale ang ma index lang kai ang 2010.

    possible bana?

    thank you.
    Maybe its possible, try daw use Array.
    Last edited by stjohnmedrano; 12-07-2010 at 09:51 PM.

  3. #3
    Array try it.

    the index would be around -4 or -3 subtracting to the maximum number of characters.
    Last edited by dodie; 12-07-2010 at 10:23 PM.

  4. #4
    ahmm ako gusto is something like this

    create index nmbr on nmbr_table (substr(nmbr,1,2));


    possible man daw ang ing ana sa oracle. but di ko kabalo unsaun na siya sa mysql >.<

    no loop involve. just plain sql queries. possible?

    thank you

  5. #5
    Quote Originally Posted by c-chan View Post
    ahmm ako gusto is something like this

    create index nmbr on nmbr_table (substr(nmbr,1,2));


    possible man daw ang ing ana sa oracle. but di ko kabalo unsaun na siya sa mysql >.<

    no loop involve. just plain sql queries. possible?

    thank you

    Please read the this link: MySQL :: MySQL 5.0 Reference Manual :: 12.1.8 CREATE INDEX Syntax

    I'll explain some for your topic.
    Creating index is only to perform faster searching capability. Although it has to consume space to store indexes. The index is only from left to right range, and the differnces of CARDINALITY.

    Just imagine an ordinary book..... with indexes / words list / at the end part of the book.

    When you assign a value for the index... you only assign value for VARCHAR, the rest of the datatypes are OK. You don't have to think much about it, just observe how currently fast the table is. If it's slow, then recreate the index again with higher value.... OPTIMIZE table again.
    Last edited by dodie; 12-14-2010 at 12:34 PM.

  6.    Advertisement

Similar Threads

 
  1. Need help on how to create password using buffalo wireless router.
    By paparoy in forum Networking & Internet
    Replies: 1
    Last Post: 12-29-2010, 10:10 AM
  2. how to create Lay-out/fOrm using wOrd or exceL
    By dada in forum Software & Games (Old)
    Replies: 1
    Last Post: 03-03-2008, 05:20 PM
  3. Any idea what application to use in creating a website?
    By maverick07 in forum General Discussions
    Replies: 5
    Last Post: 11-23-2007, 06:09 PM
  4. Replies: 0
    Last Post: 12-02-2005, 07:53 AM
  5. How to create a ISO file from a CD using Nero 6.6 version
    By Bashka in forum Software & Games (Old)
    Replies: 1
    Last Post: 11-14-2005, 10:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top