Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 322741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:58:00+00:00 2026-05-12T08:58:00+00:00

I am using Oracle 10g Enterprise edition. A table in our Oracle database stores

  • 0

I am using Oracle 10g Enterprise edition.

A table in our Oracle database stores the soundex value representation of another text column. We are using a custom soundex implementation in which the soundex values are longer than are generated by traditional soundex algorithms (such as the one Oracle uses). That’s really beside the point.

Basically I have a varchar2 column that has values containing a single character followed by a dynamic number of numeric values (e.g. ‘A12345’, ‘S382771’, etc). The table is partitioned by another column, but I’d like to add a partitioned index to the soundex column since it is often searched. When trying to add a range partitioned index using the first character of the soundex column it worked great:

create index IDX_NAMES_SOUNDEX on NAMES_SOUNDEX (soundex)
global partition by range (soundex) (
    partition IDX_NAMES_SOUNDEX_PART_A values less than ('B'),  -- 'A%'
    partition IDX_NAMES_SOUNDEX_PART_B values less than ('C'),  -- 'B%'
    ...
);

However, I in order to more evenly distribute the size of the partitions, I want to define some partitions by the first two chars, like so:

create index IDX_NAMES_SOUNDEX on NAMES_SOUNDEX (soundex)
global partition by range (soundex) (
    partition IDX_NAMES_SOUNDEX_PART_A5 values less than ('A5'), -- 'A0% - A4%'
    partition IDX_NAMES_SOUNDEX_PART_A values less than ('B'),   -- 'A4% - A9%'
    partition IDX_NAMES_SOUNDEX_PART_B values less than ('C'),   -- 'B%'
    ...
);

I’m not sure how to properly range partition using varchar2 columns. I’m sure this is a less than ideal choice, so perhaps someone can recommend a better solution. Here’s a distribution of the soundex data in my table:

-----------------------------------
|  SUBSTR(SOUNDEX,1,1)  |  COUNT  |
-----------------------------------
|                    A  | 6476349 |
|                    B  |  854880 |
|                    D  |  520676 |
|                    F  | 1200045 |
|                    G  |  280647 |
|                    H  | 3048637 |
|                    J  |  711031 |
|                    K  | 1336522 |
|                    L  |  348743 |
|                    M  | 3259464 |
|                    N  | 1510070 |
|                    Q  |  276769 |
|                    R  | 1263008 |
|                    S  | 3396223 |
|                    V  |  533844 |
|                    W  |  555007 |
|                    Y  |  348504 |
|                    Z  | 1079179 |
-----------------------------------

As you can see, the distribution is not evenly spread, which is why I want to define range partitions using the first two characters instead of just the first character.

Suggestions?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:58:01+00:00Added an answer on May 12, 2026 at 8:58 am

    What exactly is your question?

    Don’t you know how you can split your table in n equal parts to avoid skew?

    You can do that with analytic function percentile_disc().

    Here an SQL PLUS example with n=100, I admit that it isn’t very sophisticated but it will do the job.

    set pages 0
    set lines 200
    
    drop table random_strings;
    
    create table random_strings 
    as 
    select upper(dbms_random.string('A', 12)) rndmstr
    from dual 
    connect by level < 1000;
    
    
    spool parts
    
    select 'select '||level||'/100,percentile_disc('||level||
           '/100) within group (order by RNDMSTR) from random_strings;' 
           sql_statement
    from dual 
    connect by level <= 100
    /
    
    spool off
    

    This will output in file parts.lst:

    select 1/100,percentile_disc(1/100) within group (order by RNDMSTR) from random_strings;                                                                                                                
    select 2/100,percentile_disc(2/100) within group (order by RNDMSTR) from random_strings;                                                                                                                
    select 3/100,percentile_disc(3/100) within group (order by RNDMSTR) from random_strings;                                                 
    ...
    select 100/100,percentile_disc(100/100) within group (order by RNDMSTR) from random_strings;                                                 
    

    Now you can run script parts.lst to get the partition values. Each partition will contain 1% of the data initially.

    Script parts.lst will output:

       ,01 AJUDRRSPGMNP
       ,02 AOMJZQPZASQZ
       ,03 AWDQXVGLLUSJ
       ,04 BIEPUHAEMELR
       .... 
       ,99 ZTMHDWTXUJAR
       1   ZYVJLNATVLOY
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 218k
  • Answers 219k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer document.getElementbyId("yourDivid").innerHTML += drpShadow(yourPicUrl,yourWidth, yourJeight); May 12, 2026 at 11:40 pm
  • Editorial Team
    Editorial Team added an answer Here's an example of using ParameterSetName taken from a cmdlet… May 12, 2026 at 11:40 pm
  • Editorial Team
    Editorial Team added an answer Couldn't you use a min to achieve this? EG: SELECT… May 12, 2026 at 11:40 pm

Related Questions

I have recently been receiving the following error whenever I am asked to supply
I am using Oracle 10g at the moment. I want to search through all
I am developing a web application. For some reasons, I need to use external
I'm trying to get a product's name and its number of sales from two

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.