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

  • SEARCH
  • Home
  • 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 6584621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:33:33+00:00 2026-05-25T16:33:33+00:00

I have a feed that I need to parse into an android application. The

  • 0

I have a feed that I need to parse into an android application. The data needs to be stored in a data base, and Im currently having problems with the performance.

I need to categories the items into Categories and Sub Categories.

I do have ID’s for the Categories, so that is cool. But for the sub categories I don’t. This causes a lot of string comparison to make sure that no duplicates are added to the db.

Would it be good practice to generate a ID from the name of the sub category? Or is this just as painful to compute?

EDIT:

Category A (ID 1)
    Sub Category C (no ID)
    Sub Category Z (no ID)
    Sub Category V (no ID)

Category B (ID 7)
    Sub Category O (no ID)
    Sub Category C (no ID) (this is not the same Sub Category 'C' as under Category 'A')

The data looks something like this above. I store Category in one table and subcategory in another, and I don’t want to add duplicates. So in order to avoid duplicated records I need to check what already exists. But I don’t have any IDs for the Sub Cateogries

  • 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-25T16:33:34+00:00Added an answer on May 25, 2026 at 4:33 pm

    There are multiple ways to solve this problem, and it really depends on how many inserts you’re actually doing. If it isn’t too many, then it would be sufficient to index the sub-cateogory column and then before each insert simply do:

    select count(*) from sub_category_table where sub_category_field = ‘subCategory’

    If the query returns greater than 0, you can skip the insert.

    If that’s not good enough performance-wise, then it would help to have more information on your data and schema.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that needs to check a website feed every second. Sometimes
I have a string I need to feed to a com object that has
I have a series of XSL 2.0 stylesheets that feed into each other, i.e.
I have a Java application that's very String-heavy - it takes a feed of
I have a setup where I am using amcharts that is feed data via
I have RSS feed that I want to modify on fly, all I need
I have built a site that relies on an XML feed that I currently
I have a website that needs to pull information from two diffferent XML data
I need to parse a huge xml feed containing games data and download all
I have a client that sends an xml feed which I parse using the

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.