What is faster to search an alpha numeric primary key or number datatype

hi all,
I am looking for the answer to a question. What provides a faster and or efficient search for a primary key in any RDBMS is it alpha numeric or number? and why?I would appreciate you replies please.

Several years ago an Oracle support analyst posted the results of a test for a single column PK with where he compared the results for using a number data type verse a character data type. The analyst results showed you needed more than 100K accesses to measure any significant difference where the number data type showed a small performance advantage. Note that Oracle stores the number data type internally as a form of scientific notation and library math is necessary to work with the numbers. Most of the claims for using a number instead of character go back to the days where native binary words were used as the key. The test only covered signle column keys.
Use the data type that matches your natural business keys and call it a day. If you try to substitute an artificial numeric key you are likely to have to go through a business character value to locate the artificial key so any performance benefit you think you can get by using a numeric key will be imaginary due to increased overhead of maintaining multiple indexes.
You can set up and run your own tests.
HTH -- Mark D Powell --

Similar Messages

  • How to speed up fast refresh of materialized view without primary key

    Thought I'd share this info, as I couldn't find anything on here to help me diagnose the issue:
    I had a materialized view that was taking longer to perform a fast refresh than it took to perform a complete refresh. My mview had no primary key, as the base table had no primary key.
    I created a trace file for the session and saw references to a column M_ROW$$ in my mview. Nowhere in the data dictionary could I find a reference to the m_row$$ column in my mview, but apparently it exists and is created automatically. After creating the index below, the fast refresh took 6 minutes to add 500k rows to the materialized view. (versus 4+ hours without the index) When I looked in the trace file, I noticed that for each row in the mview log, it first tries to update the mview with an UPDATE statement, then it performs an insert of the new data. Seems like it should be able to determine whether to perform an update or insert based on the DMLTYPE$$ column of the mview log. What was killing my performance was the UPDATE phase. Since I had no primary key on the mview, and no index on the m_row$$ column, the UPDATE phase was performing a full table scan of my mview for every row in the mview log. I was expecting it to be smart enough to only perform inserts, as the only transactions against the base table were inserts.
    In summary: If you have a materialized view without a primary key, create an index on the m_row$$ column of the mview, even though no such column displays in the data dictionary.
    ex:
    CREATE MATERIALIZED VIEW mv_minidrr ...
    CREATE INDEX pk_mv_minidrr ON mv_minidrr(m_row$$) ...

    Well, there indeed is a column called M_ROW$$
    Your MLOG$_EMP is nothing but the materialized view log on the base table.
    SQL> create  materialized view log on emp with rowid ;
    Materialized view log created.
    SQL> create materialized view emp_mview refresh fast on demand with rowid as select * from emp ;
    Materialized view created.
    SQL> desc mlog$_emp
    Name                                                  Null?    Type
    M_ROW$$                                                        VARCHAR2(255)
    SNAPTIME$$                                                     DATE
    DMLTYPE$$                                                      VARCHAR2(1)
    OLD_NEW$$                                                      VARCHAR2(1)
    CHANGE_VECTOR$$                                                RAW(255)
    SQL> select table_name, column_name from user_tab_columns where column_name = 'M_ROW$$' ;
    TABLE_NAME                     COLUMN_NAME
    MLOG$_EMP                      M_ROW$$
    1 row selected.
    SQL>

  • What is the diffrence between Row id and primary key ?

    dear all
    my question is about creating materialized views parameters (With Rowid and
    With Primary kry)
    my master table contains a primary key
    and i created my materialized view as follow:
    CREATE MATERIALIZED VIEW LV_BULLETIN_MV
    TABLESPACE USERS
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    REFRESH FAST ON DEMAND
    WITH PRIMARY KEY
    AS
    SELECT
    BCODE ID, BTYPE BTYPE_ID,
    BDATE THE_DATE,SYMBOL_CODE STOCK_CODE,
    BHEAD DESC_E, BHEADARB DESC_A,
    BMSG TEXT_E, BMSGARB TEXT_A,
    BURL URL, BTIME THE_TIME
    FROM BULLETIN@egid_sefit;
    I need to know is there a diffrence between using (with row id) and (with primary key) on the performance of the query?

    Hi again,
    fast refreshing complex views based on rowids, according to the previous subject.
    (You're example shows that) are not possible.
    Complex remote (replication) snapshots cannot be based on Rowid too.
    for 10.1
    http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_6002.htm#sthref5054
    for 10.2
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6002.htm#sthref6873
    So I guess (didn't check it) that this applies ONLY to replication snapshots.
    This is not documented clearly though (documentation bug ?!)
    Documentation states that the following is generally not possible with Rowid MVIEWS:
    Distinct or aggregate functions
    GROUP BY or CONNECT BY clauses
    Subqueries
    Joins
    Set operations
    Rowid materialized views are not eligible for fast refresh after a master table reorganization until a complete refresh has been performed.
    The main purpose of my statements was to try to give a few tips how to avoid common problems with this complex subject, like for example: being able to CREATE an MVIEW with fast refresh clause does not really guarantee that it will refresh fast in the long run (reorganisation, partition changes) if ROWID based, further the rowid mviews have limitations according to the documentation (no group by, no connect by, link see above) plus fast refresh means only to use filter columnns of the mview logs, plus for aggregates you need additional count (*) pseudo columns.
    kind regards
    Karsten

  • What to use in jpa from self generated primary key ?

    Is it described somewhere what strategy to use with JPA when primary key are self generated by a trigger into the table ?
    Thank You

    Please see this link http://en.wikibooks.org/wiki/Java_Persistence/Identity_and_Sequencing#Primary_Keys_through_Triggers

  • I have a macbook from early 2008, and when I sign onto safari I get an error message for fast browser search plugin.  After that error comes up my computer freezes and I have to force it to shut down.  Does anyone know what that means and how I can fix it

    I have a macbook from early 2008, and when I sign onto safari I get an error message for fast browser search plugin.  After that error comes up my computer freezes and I have to force it to shut down.  Does anyone know what that means and how I can fix it?

    Means you have an incompatible Safari extension installed. Look in the /Home/Library/Safari/Extensions/ folder for the offending plug-in and delete it.

  • Spotlight bringing up alpha numeric codes for contacts, not names

    When I do a spotlight search on names, spotlight brings up long alpha numeric codes instead of the actual names of my contacts. If I click on the code, I am taken to the address book record of the contact.
    Strange...
    One code is:
    4CDBA0BE-853D-11D9-9F1A-000D932E2424:ABPerson.abcdp
    Anyone have an idea what this means and how to fix this?
    Thanks
    iMac 2 GHz Intel Core Duo   Mac OS X (10.4.6)   2 GB DDR2 SDRAM
    iMac 2 GHz Intel Core Duo   Mac OS X (10.4.6)   2 GB DDR2 SDRAM

    Hi, get_jr. Welcome to the Discussions.
    I presume you mean you are doing a Find (Finder > Command-F) search for:
    Search location: Home (selected in top slice of Find window)
    Name: Contains: nameofperson
    If you do it that way, you get the results you indicated as it's finding the extracted Address Book metadata entry that Spotlight uses to index Address Book contacts. Every Address Book contact is saved twice:
    (1) Once in the Address Book database — which Spotlight cannot index.
    (2) Again in a separate XML property list file — that Spotlight can index — in your Home > Library > Caches > com.apple.AddressBook > Metadata folder. Each Address Book contact saved in this format is given a specially generated file name that can also be used for syncing these entries with iSync and .Mac.
    The reason you see the search results from Find is that the Name search criterion searches against the kMDItemDisplayName metadata attribute. For the text files of type (2) above, the value of the kMDItemDisplayName attribute is sent to the name of the person in the contact record. However, the search results show file names, as it is a Finder window, and hence displays the specially-generate file name, rather than the contact name, since that is the file name of the result.
    If you search using the Spotlight icon for nameofperson it should return the Address Book contact using the person's name.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Alpha Numeric - GL account numbering

    Hi
    Our client is going for alpha numeric GL accounts. FS00 will allow creating alpha numeric GL accounts. But i wanted to what may be problem in future?
    I want to know will any account determination settings like OBYC (FI - MM Settings), VKOA (FI - SD settings), AO90 - Asset accounting GL determination or any other FI process will give problem at the time of configurations or in future?.
    Please help me on this. What can be the points on the basis of which i can tell client that they should go for NUMERIC GL accounts only and not Alpha Numeric.

    No other feedback ?
        Avoid using alpha characters – they will create problems in sequencing
    and sorting data in reports, assigning codes, using ranges, and when
    creating validation and/or security rules”
    What does security rules in this context ?

  • BEx report hangs- selecting Alpha numeric values

    I am working on the existing customer report
    customer is the selection parameter for my report.
    Issue is Customer has numerical and alpha numerical values.
    If i give parameter rangs of value is numerical
    01 - 500 query works fine
    01-50cust1
    50 cust1 - 195 cust2
    query hangs.
    Is their any way we can improve the query performance .
    for searching alphanumerica values.
    I have a workbook is built based on the query.
    morethan 6 queries attached in the sheet 1....sheet2
    each sheet has it is own query with values.
    when I refresh and execute the workbook with the customer alphanumerica values it hangs.
    Query is built based on the multiprovider.
    Please help me onthis

    Hello,
    Try exporting in the 'fully formated grids and text'. It shouldl give you the 'member alias' used in the report.
    Looks like if you export in the 'querry ready grids and text' it will show the 'member name' as in database although the report may have used the 'member alias'.
    Regards

  • TS3276 I need feedback for the following issue. When I send email from this 27 inch iMac, the computer adds a string of characters in vertical column that represents the QWERTY key board, all alpha numeric characters are included. Yahoo mail, issue only o

    Restating my issue / question...
    When I send email from this iMac, there is a string of characters assigned. The characters are all the "alpha numeric" characters on the QWERTY key board. This only occurs when email is sent from this iMac. The issue does not manifest when using any other lap top or computer.
    Hence, I have ruled out the issue is a yahoo mail matter.
    Again, I can access the Yahoo mail account form multiple devices and send email without unintended assignment of character strings, but when I send wmail using this iMac, the issue happens everytime.
    Characters are stacked verticaly in a column. It looks as if all characters (except function keys) are included in the string.
    Any ideas?
    GMc

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The following procedure will help identify which such modifications you've installed. Don’t be alarmed by the complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac. 
    These steps are to be taken while booted in “normal” mode, not in safe mode. If you’re now running in safe mode, reboot as usual before continuing. 
    Below are instructions to enter some UNIX shell commands. The commands are harmless, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects. 
    Some of the commands will line-wrap or scroll in your browser, but each one is really just a single line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it. The headings “Step 1” and so on are not part of the commands. 
    Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. The other steps should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply. 
    Launch the Terminal application in any of the following ways: 
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.) 
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens. 
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid. 
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign. 
    Step 1 
    Triple-click the line of text below to select it:
    kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}' | open -f -a TextEdit 
    Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste (command-V). A TextEdit window will open with the output of the command. Post the contents of that window, if any — the text, please, not a screenshot. You can then close the TextEdit window. The title of the window doesn't matter, and you don't need to post that. No typing is involved in this step.
    Step 2 
    Repeat with this line:
    { sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix)|org\.(amav|apac|cups|isc|ntp|postf|x)/{print $3}'; sudo defaults read com.apple.loginwindow LoginHook; } | open -f -a TextEdit 
    This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. 
    Note: If you don’t have a login password, you’ll need to set one before taking this step. If that’s not possible, skip to the next step. 
    Step 3
    launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)/{print $3}' | open -f -a TextEdit 
    Step 4
    ls -1A /e*/mach* {,/}L*/{Ad,Compon,Ex,Fram,In,Keyb,La,Mail/Bu,P*P,Priv,Qu,Scripti,Servi,Spo,Sta}* L*/Fonts 2> /dev/null | open -f -a TextEdit  
    Important: If you formerly synchronized with a MobileMe account, your me.com email address may appear in the output of the above command. If so, anonymize it before posting. 
    Step 5
    osascript -e 'tell application "System Events" to get name of every login item' | open -f -a TextEdit 
    Remember, steps 1-5 are all copy-and-paste — no typing, except your password. Also remember to post the output. 
    You can then quit Terminal.

  • Unable to replicate both Numeric and alpha numeric vendors records from R3

    Dear all,
    In our ECC 5 environment, we have some vendors who master record numbers that are numeric internally assigned i.e 7000000 or 23000000 and some alphanumeric externally assigned i.e SmallBusiness1 or Grinad10. This is posible as you may know via vendor account groups.
    We have implemented a classic scenario in SRM 4, Server 5 environment, therefore we need to replicate ECC backend vendors masters. We initally set SAP's AB business Partner (vendors) number range in SRM to A  - zzzzzzzz and created numeric number ranges to match thoes set up for all our vendors in ECC.
    When we ran BBPGETVD only the alpha numeric vendors records replicated down to SRM. The numeric were ingnored. The BBPGETVD t-code was reporting that the other vendors had incorrect data.
    We then chnaged the AB Business Partner (vendor)number range to 000000001 - 999999999 and ran BBPGETVD. Only then did the numeric vendors get replicated down to SRM. But the issue is now, I cannot replicate the alpha numeric with out chaanging the number range back to A - zzzzzzzzz.
    Question,
    How can I set the Business Partner(Vendor) number range in SRM to anable the replication of both Numeric and Alpha numeric assigned vendor records down to SRM.
    Thanks,
    Grace

    Christophe,
    PLEASE HELP I HAVE AN URGENT ISSUE NOW!!!
    On the subject of setting back the internal BP number range, does SRM expect it to be set for example to:
    01  0000000001 - 0000999999?
    Should the grouping for this internal number range be also ways set to 0001. Iam refernceing the settings in our sandbox client, they seam to be set up that way.
    If its set to say 0003, will this cause a problem?
    Because we have set all our BP ranges to external, any ORG unit, USER or position that we created after we "removed" the internal number range does appear to be working.
    I have noticed this. when I login as a new user and try to create a shopping cart, tthe product category drop down does not work on the "new user".
    If I go in the BP transaction and search for this new user or new unit org units that where created after the removal of the internal number range nothing is found!. The last internal BP number is 105.
    Question.
    If I set the internal number range back to
    01 0000000001 - 0000099999 and set the current number to 106, then delete and recreate the org units, do you think this will work?
    Please help I need to get this issue sorted out because as you said no new org unit/user can be setup.
    Thanks Again.
    Grace

  • Why are alpha/numeric keys inoperative on aluminum apple wireless keyboard

    This is a follow on to previous topic that i answered.
    I was able to get my wireless keyboard partially operational.
    It is paired and only partially functionall
    • Alpha numeric keys do not work
    • Delete Key (backward) and fn-Delete (forward) work
    • Arrow keys work
    • Function keys and
    • Mouse keys are working 8 (up), k (down), u (left), o (right), 7 (up diagonal left), l (down diagonal right), j (down diagonal left, 9 (up diagonal right). i is the mouse click.
    i am leaving this up for the benefit of other Wireless Keyboard users.
    THE APPARENT PROBLEM IS IN THE UNIVERSAL ACCESS PREFERENCES.
    I just hit Opt key five times and now the Wireless Keyboard is working very well. The mouse keys are now normal keys for Alpha Numerics. Note i am typing 8, k, u, o, 7, l, j, 9, i. . Now do Opt five times.
    (typed on my USB keyboard) There is a alarm sound when the change over occurs. Now the Alpha Numerics are inoperative and the mouse keys work. Remember that the wireless keyboard does not have a number pad. Therefore; when mouse keys are activated the above alphanumeric keys take the place of number pad 8, 2. 4. 6, 7, 3, 1, 9, and 5.
    Now back to the wireless keyboard. From top to bottom, left to right lower case keys:
    zxcvbnm,./ asdfghjkl;', qwertyuiop[]\ `1234567890-=
    From top to bottom, left to UPPER CASE keys:
    ZXCVBNM,./ ASDFGHJKL:" QWERTYUIOP{}| ~!@#$%^&*()_+
    So i answered my question and leave it for your benefit. One other comment:
    When i first set up the keyboard and spent half a day yesterday thinking i was getting nowhere because the green ON light was out. Chalk that up to what i consider poor documentation which didn't describe normal operating conditions.
    It isn't supposed to light except during initial setup when it flashes. The caps lock key lights when it is pressed SO THAT IS A GOOD INDICATION THE KEYBOARD IS ACTIVE.
    Regards: The General

    General, you are a genius. This happened to me just last week. I racked my brain trying to figure it out. Apple Care had no idea and recommended I exchange my keyboard for a new one, which I did. The problem still persisted. I tried deleting my bluetooth plist and using a USB keyboard which resulted in disaster when I used the number pad and suddenly my mouse no longer worked.
    I scoured the literature looking for some sort of key-lock function and found zip. Apple Care told me to take in the entire CPU. Unsatisfied with that, I researched further and found your thread. I told Apple Care they need to tell Apple to make a note of this in their literature!
    Thanks again!

  • Removing non-alpha-numeric characters from a string

    How can I remove all non-alpha-numeric characters from a string? (i.e. only alpha-numerics should remain in the string).

    Or even without a loop ?
    Extract from the help for the Search and Replace String function :
    Right-click the Search and Replace String function and select Regular Expression from the shortcut menu to configure the function for advanced regular expression searches and partial match substitution in the replacement string.
    Extract from the for the advanced search options :
    [a-zA-Z0-9] matches any lowercase or uppercase letter or any digit. You also can use a character class to match any character not in a given set by adding a caret (^) to the beginning of the class. For example [^a-zA-Z0-9] matches any character that is not a lowercase or uppercase letter and also not a digit.
    Message Edité par JB le 05-06-2008 01:49 PM
    Attachments:
    Example_VI_BD4.png ‏2 KB

  • Removing alpha numeric characters

    Hi,
    Can anybody please tell me how can I remove the alpha numeric characters, inluding spaces from a column value.
    Thanks in advance

    Thanks for the help. But this extracts the alpha
    numeric characters and and print those. What I need
    is i want all those column values without these alpha
    numeric characters.You said...
    Can anybody please tell me
    how can I remove the alpha numeric characters, inluding spaces from a column value.So I showed you to to remove alpha numeric characters and spaces from a column value.
    So I think you need to be clear in your requirements.
    Do you want all rows where there are values that only have alpha numerics in them i.e. don't show the rows that have non-alpha numeric or spaces in a particular value?
    or
    Do you want all rows, but you want to strip out non alpha-numerics and spaces from particular values?
    Perhaps if you give an example of your data and what you expect the result to be that may give us a better idea, because what I gave you as a solution was correct for the requirement you specified.

  • Gists Created with non alpha numeric characters

    Hi,
    I am using Gists in my APEX application. When I upload a word document that contains tables and charts, I get a really long unmeaningful gist for that document.
    For example, I get this gist (5x longer):
    PROJECT MINT ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— PROJECT MINT ———————————————————————————————————————— ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— PROJECT MINT ——————————————————————————————————————————————————————————————————————————————————————————————————————
    How can I only return or create gists that are alpha numeric?
    Thanks,
    jnguyen

    There might be another option that I'm not aware of, but this might just do the trick for you (I don't have a live Oracle connection available to me at this moment so I couldn't test it, you might need to debug it):
    select * from tablename where 0 <> length(replace(translate(lower(columnname),'abcdefghijklmnopqrstuvwxyz1234567890',' '),' ',''));
    What it does is it takes the string from the column, converts all letters and digits into spaces, removes the spaces and compares the length with 0. If the string contains 'strange' characters, they will not get removed and thus turnup a length greater than 0. Pittfalls:
    1) Make sure the number of spaces in the second argument of the translate is equal to the number of characters in the first argument.
    2) This doesn't make use of indexes...
    HTH,
    Lennert

  • What is faster Me.Filter or Me.RecordSource

    I created a form that Search As You Type. When you type in a combo box, Access displays matching records. I use the On Change event with a private Sub. To find the records you can use the Form Filter or Form RecordSource property with a Sql Where Clause.
    Finding the records is compute intensive. In general, what is faster to use:
    Me.Filter or Me.RecordSource?
    Thanks

    See
    Good Design Generally - Filter or Change RecordSource?
    In short: it doesn't matter much but one or the other may be preferable depending on the circumstances.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

Maybe you are looking for

  • Can iTunes utilize more than one external hard drive at once?

    A couple of years ago we had the bright idea to get a mac mini with an external hard drive and load it up with movies and such, so when we wanted to watch a tv show or movie, we could just scroll through the titles and pick without having to deal wit

  • How do I write in a PDF-form?

    I´m an amateur (and 73+) in the PC-field, so please give your advice in an elementary way. I´ve a free download of Acrobat Reader 9.0 and when I get a form with several empty text-boxes in PDF I´m unable to find out how to fill out the text-boxes wit

  • What iPhoto version is compatible with Lion OSX 10.7.5 and will it let me make photo calendars?

    What iPhoto version is compatible with Lion OSX 10.7.5 and will it let me make photo calendars? I have just upgraded from Leopard to Lion (via Snow Leopard) because I could no longer order photo calendars with iphoto 7.1.5.  However, I still have iph

  • OS deleted on mac mini mid 2007

    Hi all I have got mac mini mid 2007 from my friend and it has got windows 7 installed through bootcamp but there is not any OS. I think my friend has deleted it. I want to give this mini to my son and he wants OS on it. please any one could help me o

  • Missing Slideshow in iPhoto

    I created a slideshow.  It appears on the sidebar under "Slideshows".  I now wish to upload that slideshow to You Tube.  Dumb bunny that I am, I cannot locate the file to upload this slideshow to You Tube.  I simply cannot find it, even though I have