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 9252331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:55:05+00:00 2026-06-18T10:55:05+00:00

I have a SQL Query that comprise of two level sub-select. This is taking

  • 0

I have a SQL Query that comprise of two level sub-select. This is taking too much time.

The Query goes like:

   select * from DALDBO.V_COUNTRY_DERIV_SUMMARY_XREF
    where calculation_context_key = 130205268077
    and DERIV_POSITION_KEY in 
          (select ctry_risk_derivs_psn_key 
            from DALDBO.V_COUNTRY_DERIV_PSN
            where calculation_context_key = 130111216755 
            --and ctry_risk_derivs_psn_key = 76296412
            and CREDIT_PRODUCT_TYPE = 'SWP OP'
            and CALC_OBLIGOR_COUNTRY_OF_ASSETS in 
                (select ctry_cd 
                 from DALDBO.V_PSN_COUNTRY
                 where calculation_context_key = 130134216755 
                --and ctry_risk_derivs_psn_key = 76296412
                )
           )

These tables are huge! Is there any optimizations available?

  • 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-06-18T10:55:07+00:00Added an answer on June 18, 2026 at 10:55 am

    Without knowing anything about your table or view definitions, indexing, etc. I would start by looking at the sub-selects and ensuring that they are performing optimally. I would also want to know how many values are being returned by each sub-select as this can impact performance.

    How is calculation_context_key used to retrieve rows from V_COUNTRY_DERIV_PSN and V_PSN_COUNTRY? Is it an optimal execution plan?

    How is DERIV_POSITION_KEY and CALC_OBLIGOR_COUNTRY_OF_ASSETS used in V_COUNTRY_DERIV_SUMMARY_XREF to retrieve rows? Again, look at the explain plan.

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

Sidebar

Related Questions

I have this SQL query that I'm writing using Postgresql . select * from
I have an SQL query that looks like this: SELECT DISTINCT UserId, PoliticianId FROM
I have an SQL query that goes like this: $stmt = $dbh->prepare(INSERT INTO Places
Suppose I have a SQL query that looks like this: SELECT fName from employees
I have an SQL query that selects from two inner joined tables. The select
I have a SQL query that does some ranking, like this: SELECT RANK() OVER(PARTITION
I have this SQL Query that pulls data from 3 tables. I am unable
I have a SQL query that returns a Datatable: var routesTable = _dbhelper.Select(SELECT [RouteId],[UserId],[SourceName],[CreationTime]
I have a sql query that is very slow: select number1 from mytable where
I have a SQL query that I'm currently solving by doing two queries. I

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.