Query using progressive relaxation take more time for execution

HI gurus,

I'm creating a query using the context and the progressive relaxation index

I had started using progressive relaxation after obtaining the forum entries {: identifier of the thread = 2333942}. With the help of progressive relaxation takes more than 7 seconds for each request. Is there a way we can improve the query performance?
 create table test_sh4 (text1 clob,text2 clob,text3 clob);

begin
   ctx_ddl.create_preference ('nd_mcd', 'multi_column_datastore');
   ctx_ddl.set_attribute
       ('nd_mcd',
        'columns',
        'replace (text1, '' '', '''') nd1,
         text1 text1,
         replace (text2, '' '', '''') nd2,
         text2 text2');
   ctx_ddl.create_preference ('test_lex1', 'basic_lexer');
   ctx_ddl.set_attribute ('test_lex1', 'whitespace', '/\|-_+');
   ctx_ddl.create_section_group ('test_sg', 'basic_section_group');
   ctx_ddl.add_field_section ('test_sg', 'text1', 'text1', true);
   ctx_ddl.add_field_section ('test_sg', 'nd1', 'nd1', true);
   ctx_ddl.add_field_section ('test_sg', 'text2', 'text2', true);
   ctx_ddl.add_field_section ('test_sg', 'nd2', 'nd2', true);
 end;

create index IX_test_sh4 on test_sh4 (text3)   indextype is ctxsys.context   parameters    ('datastore     nd_mcd   lexer test_lex1 section group     test_sg') ;

alter index IX_test_sh4 REBUILD PARAMETERS ('REPLACE SYNC (ON COMMIT)') ;-- sync index on every commit. 


SELECT SCORE(1) score,t.* FROM test_sh4 t WHERE CONTAINS (text3,  '
<query>
<textquery>
<progression>
<seq>{GIFT GRILL STAPLES CARD} within text1</seq>
<seq>{GIFTGRILLSTAPLESCARD} within nd1</seq>
<seq>{GIFT GRILL STAPLES CARD} within text2</seq>
<seq>{GIFTGRILLSTAPLESCARD} within nd2</seq>
<seq>((%GIFT% and %GRILL% and %STAPLES% and %CARD%)) within text1</seq>
<seq>((%GIFT% and %GRILL% and %STAPLES% and %CARD%)) within text2</seq>
<seq>((%GIFT% and %GRILL% and %STAPLES%) or (%GRILL% and %STAPLES% and %CARD%) or (%GIFT% and %STAPLES% and %CARD%) or (%GIFT% and %GRILL% and %CARD%)) within text1</seq>
<seq>((%GIFT% and %GRILL% and %STAPLES%) or (%GRILL% and %STAPLES% and %CARD%) or (%GIFT% and %STAPLES% and %CARD%) or (%GIFT% and %GRILL% and %CARD%)) within text2</seq>
<seq>((%STAPLES% and %CARD%) or (%GIFT% and %GRILL%) or (%GRILL% and %CARD%) or (%GIFT% and %CARD%) or (%GIFT% and %STAPLES%) or (%GRILL% and %STAPLES%)) within text1</seq>
<seq>((%STAPLES% and %CARD%) or (%GIFT% and %GRILL%) or (%GRILL% and %CARD%) or (%GIFT% and %CARD%) or (%GIFT% and %STAPLES%) or (%GRILL% and %STAPLES%)) within text2</seq>
<seq>((%GIFT% , %GRILL% , %STAPLES% , %CARD%)) within text1</seq>
<seq>((%GIFT% , %GRILL% , %STAPLES% , %CARD%)) within text2</seq>
<seq>((!GIFT and !GRILL and !STAPLES and !CARD)) within text1</seq>
<seq>((!GIFT and !GRILL and !STAPLES and !CARD)) within text2</seq>
<seq>((!GIFT and !GRILL and !STAPLES) or (!GRILL and !STAPLES and !CARD) or (!GIFT and !STAPLES and !CARD) or (!GIFT and !GRILL and !CARD)) within text1</seq>
<seq>((!GIFT and !GRILL and !STAPLES) or (!GRILL and !STAPLES and !CARD) or (!GIFT and !STAPLES and !CARD) or (!GIFT and !GRILL and !CARD)) within text2</seq>
<seq>((!STAPLES and !CARD) or (!GIFT and !GRILL) or (!GRILL and !CARD) or (!GIFT and !CARD) or (!GIFT and !STAPLES) or (!GRILL and !STAPLES)) within text1</seq>
<seq>((!STAPLES and !CARD) or (!GIFT and !GRILL) or (!GRILL and !CARD) or (!GIFT and !CARD) or (!GIFT and !STAPLES) or (!GRILL and !STAPLES)) within text2</seq>
<seq>((!GIFT , !GRILL , !STAPLES , !CARD)) within text1</seq>
<seq>((!GIFT , !GRILL , !STAPLES , !CARD)) within text2</seq>
<seq>((?GIFT and ?GRILL and ?STAPLES and ?CARD)) within text1</seq>
<seq>((?GIFT and ?GRILL and ?STAPLES and ?CARD)) within text2</seq>
<seq>((?GIFT and ?GRILL and ?STAPLES) or (?GRILL and ?STAPLES and ?CARD) or (?GIFT and ?STAPLES and ?CARD) or (?GIFT and ?GRILL and ?CARD)) within text1</seq>
<seq>((?GIFT and ?GRILL and ?STAPLES) or (?GRILL and ?STAPLES and ?CARD) or (?GIFT and ?STAPLES and ?CARD) or (?GIFT and ?GRILL and ?CARD)) within text2</seq>
<seq>((?STAPLES and ?CARD) or (?GIFT and ?GRILL) or (?GRILL and ?CARD) or (?GIFT and ?CARD) or (?GIFT and ?STAPLES) or (?GRILL and ?STAPLES)) within text1</seq>
<seq>((?STAPLES and ?CARD) or (?GIFT and ?GRILL) or (?GRILL and ?CARD) or (?GIFT and ?CARD) or (?GIFT and ?STAPLES) or (?GRILL and ?STAPLES)) within text2</seq>
<seq>((?GIFT , ?GRILL , ?STAPLES , ?CARD)) within text1</seq>
<seq>((?GIFT , ?GRILL , ?STAPLES , ?CARD)) within text2</seq>
</progression>
</textquery>
<score datatype="FLOAT" algorithm="default"/>
</query>',1) >0 ORDER BY score(1) DESC

Progressive relaxation works best when you select only a limited number of lines. If you retrieve ALL the rows that satisfy the query, then every step of easing should run without worrying.

If you collect - say - the first 10 results, then if the first step in the relaxation gives 10 results so there is no need to execute the next step (actually, due to the internal buffering, which won't be exactly true but he is theoretically correct).

The easiest way to proceed is to reformulate the query in the form

SELECT * FROM)
(Score select (1) SCORE, t.* FROM test_sh4 t WHERE CONTAINS (Text3, '))


...


(1) > 0 ORDER BY score (1) DESC
)
WHERE ROWNUM<=>

You have discovered that wildcards don't work too well, unless you use SUBSTRING_INDEX. I encourage you to avoid completely if possible, or push down much lower in the progressive relaxation. Usually, GIFT % is a useful term (matches GIFTS, GIFTED, etc.), DON % is generally more effective.

There are a lot of steps in your progressive relaxation. It you want to reduce the number of steps, you can change:

((GIFT and percent of the GRID and STAPLES % and CARD %)) in Text1
((GIFT and percent of the GRID and STAPLES % and CARD %)) in Text2

TO

((CADEAU % et % de la GRILLE et AGRAFES % et CARTE %) * 2) within Text1 ACCUM ((GIFT and percent of the GRID and STAPLES % and CARD %)) in Text2

I don't know if it would have performance benefits - but it is worth trying to see.

Tags: Database

Similar Questions

  • like firefox updates, it takes more time for the program to load, using win 7 it takes 17secs toopen window

    One of the reasons for the use of firefox is its ability to be in place and ready to use quickly (I was one of the first users.) Now, Google and dare say int explore seem to have the advantage

    One possible cause is security software (firewall) that blocks or limits Firefox or plugin-container process without informing you, possibly after the detection of changes (update) for the Firefox program.

    Delete all rules for Firefox in the list of permissions in the firewall and leave your firewall again ask permission to get full unlimited access to the internet for Firefox and the plugin-container and the update process.

    See:

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

    Create a new profile as a test to see if your profile is the source of the problems.

    See "basic troubleshooting: a new profile:

    There may be extensions and plugins installed by default in a new profile, so check that in "tools > Modules > Extensions & Plugins" in case there are still problems.

    If this new profile works then you can transfer files from the old profile to the new profile, but make sure not to copy corrupted files.

    See:

  • Cannot use the calendar network unavailable or slow app. The application takes more time to load than expected.

    When you use iCloud on my iMac I get the message "network unavailable or slow. The application takes more time to load than expected. "This has been the case for several hours, but other applications I use (Mail, Contacts, Notes, reminders), all seem to work well.  The

    I have the same message when I try to load the reminders in iCloud. All other applications work correctly. This issue has been ongoing for about a month now.

    Have this problem on my work computer running Windows 7 SP1 Pro and Macbook Air late 2009 w / OS X 10.11

  • NewElementInHierarchy() - adding new items, gradually takes more time when adding several brothers and sisters

    With my script ESTK, users select the model numbers in the list and then the script inserts an element with a model number is entered in an attribute, an element for each selected model.

    When you add a large number of elements, each element of extra brother takes a little more then the previous item adds. Adding 250 items may take longer than 3-1/2 minutes or more. During the addition of 20, 50 or 75 items happens quickly, without any noticeable length. It is somewhere in the top 110, this is where that starts to get noticed.

    I even used $.hiresTimer and writes the value to the console for each time a model has been added. Because the timer is reset to zero (0) whenever it is called, it was easier to notice than the amount that it incremented from one element to the other got progressively bigger.

    Any ideas as to why it takes so long or reflections on what I could do to speed it up?

    The structure looks like this:

    < PartModels >
    Text < NoteText > < / NoteText >
    < model ModelNumber = "ABC01" / >
    < model ModelNumber = "ABC02" / >
    < model ModelNumber = "DEF03" / >
    < model ModelNumber = "DEF04" / >


    < model ModelNumber = 'XYZ01-A' / >
    < model ModelNumber = "XYZ * B" / >
    < model ModelNumber = "XYZ500" / >
    < / PartModels >

    The script is quite simple: scroll a selected model numbers table, add a new item for each model number and value of the attribute, the value of the model number. It's the short version:

    Function InsertModelElements (modelsToIns, insElemLoc, GVdoc) {}

    var newEleId;

    var newElemLoc = insElemLoc;

    var elemDef is GVdoc.GetNamedElementDef ("Model");.

    for (var i = 0; i < modelsToIns.length; i ++) { / / modelsToIns is the selected model range }

    newEleId = elemDef.NewElementInHierarchy (newElemLoc); //ElementLoc based on NoteText first, last, or absent

    SetAttribute (newEleId, "ModelNumber", null, modelsToIns [i]); //More feature robust to set the attribute

    / * Which also works for the layout attribute * /.

    var vattributes = newEleId.GetAttributes ();

    vattributes values [0] [0] = modelsToIns [i];

    newEleId.Attributes = vattributes;


    / * At one point, I tried to use a new location of the item to the last inserted element, no change * /.

    var newElemRange = setElementSelection (GV_doc, EleId); function that returns the range

    newElemLoc = newNewElemRange.end;

    }

    }

    Any help is appreciated.

    Sincerely,

    Trent

    Thanks Russ,

    I seriously considered trying to copy/paste and started to change the code to do it. But I could not let pass, the answer should be right there in front of me, it's all too long that I worked with this stuff, I am not able to see. Then it dawned on me what's happening.

    In a previous test, I put a timer on each action that is closed. For example, I start with a container element that has 200 children of elements, each with a specific/unique model number attribute. All the 200 existing items are deleted and then replaced with 250 new items with a different value for the attribute of model number. The timer was placed after the Element.Delete () and ElementDef.NewElementInHierarchy () methods. What I've noticed with the timer, it's that each deleted item has been removed as fast as the previous item (so it took progressively less and less time to remove an item). And of course the opposite was noted for insert items, each inserted item has taken longer than the previous inserted item.

    These elements can be inserted in two areas of the structure, one of the neighborhoods within format rules that affect the formatting and is actually a bit faster. This led me to the cause being ESD format rules. The area that takes more time has quite a few rules of extensible format that apply. Whenever an element is inserted or deleted, FrameMaker through these rules for formatting the content of elements. Given that the rules apply to the parent, first, last, next, previous, etc., FrameMaker must apply the rules of the format to all elements of the structure that the rules (which are extremely complex due to various elements, attribute values, and combinations that can be inserted).

    Removal or thinning of the FormatRules in ESD, she becomes faster. But each of the FormatRules are needed. So using app. ApplyFormatRules = false; just before that the elements are deleted and inserted works very well. But the key is to implement ApplyFormatRules return to true before remove the last element should be removed and before inserting the last element to be inserted, so it allows to scroll all the rules of format of ESD for all elements in the hierarchy of these format rules apply to. ApplyFormatRules true and assign the ElementDef until the last item works also [EleId.ElementDef = GV_doc. GetNamedElementDef (insElemType);], but only before all the other functions are performed or different items are added.

    doc. Reformat() will not reformat the content correctly after the fact, because the element has been created without the format rules, so it reformats all the contents of the elements without the format rules.

    The FDK version which was created 10 years ago had the same problem of slow operation when a large number of items have been inserted, but was still an improvement over having manually insert each item, and then type the value of the attribute, if she had lived with.

    He now works surprisingly fast. I hope that my explanation of what I think is happening, including the cause/solution, is understandable.

    Sincerely,

    Trent Schwartz

  • My computer takes more time to put on than before. Why is this?

    Original title: slow system

    My computer takes more time to put on than before. Is this because too many files on my computer?

    Take a look in the system and Application logs in the errors and warnings event viewer and post here the copies. Do not post on that more than 48 hours ago.

    You can access event viewer by selecting Start, Control Panel, administrative tools, and Event Viewer. When searching for the meaning of the error, information about the event ID, Source and Description are important.

    A tip for posting copies of error reports! Run Event Viewer and double-click the error you want to copy. You will see a button resembling two pages. Click on the button and close Event Viewer. This places a copy of the report to your Clipboard. Paste it into the body of your message. Make sure that it is the first dough right out of the event viewer.

    Try Ctrl + Alt + Delete, select Task Manager, and then click the performance tab. Under Commit Charge, which is the Total, limit, and the pic?

    You should be able to gather more information from the Task Manager. Open the process tab, select View, Select, columns and check the boxes before maximum memory usage and virtual memory size. What are the figures for the 6 process using larger quantities?

    Select Start, all programs, accessories, System Tools, cleaning disk to emptying your trash, delete temporary Internet files and other selected options. I recommend also you click Other Options, System Restore and delete all but the last system restore point. Run Disk Defragmenter.

    Using the system restore option is most appropriate when your system is slow and you need to increase the free disk space on your C partition. If you have errors that could be solved by using the system restore to your system settings back to before the error occurred initially do not use this option.

    If more than one person uses the computer and they have their own user log you need to run Disk Cleanup in each user profile that you want to delete all the unwanted files.

    A better program of disk cleanup is cCleaner but note that cCleaner will not manage system restore points. Remove the old restore points can be important if you have little free disk space. cCleaner comes with a registry tool. Do not use this tool as any registry cleaner could lead to the creation of very difficult to resolve system errors.

    http://www.CCleaner.com/download

    Hope this helps, Gerry Cornell

  • All of a sudden ODI should take more time than usual executions.

    Hello

    I put packages ODI scheduled for execution.
    Since a few days those who take more time to run.
    Before they used to take 1 hour and 30 minutes approx.
    Now they take 3-3 h 15 min approx.
    And there no any significant changes in the data in terms of quantity.

    My ODI s version

    Standalone Edition Version 11.1.1
    Build ODI_11.1.1.3.0_GENERIC_100623.1635

    ODI packages mainly use Oracle as a SOURCE and TARGET DB.

    What is - that I need to check to find out the reasons for the sudden increase at run time.

    Indications in this regard would be appreciated.

    Thank you
    Mahesh

    Mahesh,

    Some queries of the repository allows to retrieve the task of session timings and compare your slow performance to a previous acceptable run, then look the most important changes - it will highlight where you slow down, then its judgment to resolve the matter accordingly.

    See here for some example reports, you might need to tweak to your current version of rest, but I don't think that the table structures have changed that much:
    http://rnm1978.WordPress.com/2010/11/03/analysing-ODI-batch-performance/

  • MY VAIO LAPTOP(VGN-CR353) RANDOMLY STOPS AND TAKES MORE TIME TO START. SOMETIMES IT STOP WHEN STARTING

    MY VAIO LAPTOP(VGN-CR353) RANDOMLY STOPS AND TAKES MORE TIME TO START. SOMETIMES IT STOP WHEN STARTING

    It seems that the laptop may be overheating.  Are you sure there is enough air past for laptop?  Make sure that it is on a flat surface, with nothing to obstruct the ventilation openings.  Make sure that the vents and fans and heat sinks are free from dust - examine their blowing with compressed air (power of the system first, of course).  Depending on the laptop model, it may be relatively easy to blow off the dust with compressed air, or otherwise clean up things a bit.   Fans should be kept up well - only no right turn when being ripped off.  My Dell laptop has a removable fan (two small screws need to be removed) that can easily be blown.  This also allows access to the fins of the heatsink.

    Some laptops also have a removable filter that traps the dust and must be regularly inspected and cleaned.

    Are all the BIOS settings for the adjustment of the temperature, the value lower than the manufacturer's recommendations and the default values (you need to check the manual of your laptop for this).  Also make sure you run the latest version of BIOS (again, the manual of your laptop would have the details; the manufacturer's website should also have this information).

  • He said "extraction... it may take some time" for 2 days. Is this normal? What should I do?

    He said "extraction... it may take some time" for 2 days. Is this normal? What should I do?

    No, it has long been the point of no return. Download again using anotehr browser / method such as described here:

    Direct download links for Adobe software

    Mylenium

  • Satellite C55-B854 - right click takes more time

    My laptop Satellite C55-B854 takes more time in the right click. Here are few 8.1 window pro.32

    Hello

    Unfortunately, it is not easy to understand. What do you mean exactly with takes longer in a right-click?
    Your laptop is may be busy and when you click the right mouse button to open a menu it takes little time to seconds before it is displayed on the screen.

  • update my Photoshop cc through my creative cloud and now takes more time to open the psb files that yesterday were beautiful, moving same layers autour, I now get the beachball! any suggestions?

    update my Photoshop cc through my creative cloud and now takes more time to open the psb files that yesterday were beautiful, moving same layers autour, I now get the beachball! any suggestions?

    Perhaps a preferences Reset could fix.  Cmd k will lead you to the Photoshop preferences where you will see this screen.

  • After you have created a folder that it does not apper when refreshing and save files, it takes much more time for it.how to fix this?

    When I create a new folder, unable to see her. Once I updated it seems. where to save a file to a software (ms word or all), the waiting ring appear more time and save it.

    Windows 7 ultimate service pack 1
    Corei7 3.4
    8 GB ram

    Hello

    Glad to know that you were able to solve the problem. Your efforts to solve this problem is appreciated. Feel free to post your request here on the Forums of Windows, we would be happy to help you.

    Thank you.

  • Activation loop parallelism seems to take more time

    Hi guys,.

    I was benchmarking of a VI to see how much time was saved by activating the parallelism of the loop. The loop uses only select and multiplication on an array of 2048 elements. To my surprise, allowing parallelism increased run time! Please see if you can recreate what I see by changing the parallelism of loop in the Sub - VI attached (Calc Wavelength.vi Central) and by changing the number of parallel loops allowed. Then run Test Calc Wavelength.vi Central to see how long it takes. The loops I'm welcome, plus it takes! Thanks for any idea.

    Parallelism requires some resources in order to divide and back up data. etc... If your loop code doesn't do much, General fresh parallelism is relatively large and can you even slow worms down.

  • Buy more time for VCIX-NV

    Hello

    I got this question in my mind. I have until the end of January 2016 to the exam of the VCIX-NV (for CCIE's). My question is... If I spent the VCP - NV-> VCPC610 which is expiring end of November that buy me more time? or this review at the end I will not be SECURE and will not be able to take the 1st road?  any experince with vmware certs?


    (VCIX-NV) VMware certified Expert of implementation

    Kind regards

    VCPs last for 2 years. If you are 'current' as long as you have earned the certification less than 2 years ago.

    Get your VCP - NV first - then you can win VCIX-NV until the examination for certification has not been removed, and is not ;-) 2018

  • Query takes more time to execute the query

    Hi all

    Want to help out me, I am request runing takes longer run time.

    Query:

    Select


    *



    Of


    (

    SELECT

    Decode (cla.r_description, 'Central région', 'CR', 'Southern', 'SR', "Northern Region", 'NR', 'Region of Mehran', 'SIR', 'Quetta HO', 'QHO') as a region.
    ''''|| TO_CHAR (trx.trx_number) as challan_Num,
    St.Account_Number as Roll_Number,
    St.party_name as Student_Name
    CLA.class_name: '-' | St.section as Class_Section,
    period.period_name as Fee_Period,
    pay. TRX_DATE as Issue_date,
    pay. End_date as end_date,
    Pay.due_date as valid_date,
    Amount pay.amount_due_remaining

    Of
    ra_customer_trx_all trx,
    St the_city_school_students,
    class_v_table cla,
    period of bill_period
    ar_payment_schedules_all pay
    WHERE

    Trx.attribute_category = nvl(:P_CHALLAN_TYPE,trx.attribute_category)
    AND trx.attribute2 = cla.fee_structure_id
    AND trx.bill_to_customer_id = st.cust_account_id
    AND trx.org_id = nvl(:p_org_id,trx.org_id)
    AND trx.attribute1 = period.period_id
    AND trx.customer_trx_id = pay.customer_trx_id
    AND cla.branch_id = NVL (: p_branch, cla.branch_id)
    AND to_char(trx.creation_date,'YYYY/MM/DD') between substr(:p_date_from,1,10) and substr(:p_date_to,1,10)
    and pay.amount_due_remaining > 0

    - AND cla.class_name = NVL (p_class, cla.class_name)

    UNION ALL

    Select

    decode (A.r_description region, 'Central', 'CR', 'Southern', 'SR', "Northern Region", 'NR', 'Region of Mehran', 'SIR', 'Quetta HO', 'QHO') as region
    acd. ADM_CHALLAN_NO as challan_Num
    bsr. STUDENT_REGISTRATION_NO as Roll_Number
    bsr. STUDENT_NAME as Student_Name
    British Colombia. Class_name as Class_Section
    ,' ' as Fee_Period
    acd. ADM_ISSUE_DATE as Issue_date
    acd. ADM_due_DATE as end_date
    acd. ADM_due_DATE as valid_date
    quantity (ac.original_total + ac.adm_original_optional_total)


    of bill_student_registration bsr
    adm_challan ac
    adm_challan_detail acd
    bill_class, BC.
    branch_network_region_link one

    where
    AC. STUDENT_REGISTARTION_ID = bsr. STUDENT_REGISTRATION_ID
    AND British Colombia. CLASS_ID = bsr. REGISTRATION_CLASS_ID
    AND a.BRANCH = bsr. BRANCH_ID
    AND ac.adm_challan_id = acd.adm_challan_id
    - and ADM_PAID = n
    AND bsr.ORG_ID = nvl(:p_org_id,bsr.ORG_ID)
    AND to_char (bsr. STUDENT_REGISTRATION_DATE, ' DD/MM/YYYY') between substr(:p_date_from,1,10) and substr(:p_date_to,1,10)
    AND decode (A.r_description region, 'Central', 'CR', 'Southern', 'SR', "Northern Region", 'NR', 'Region of Mehran', 'SIR', 'Quetta HO', 'QHO') is not null
    AND bsr. BRANCH_ID = NVL (: p_branch, bsr.) BRANCH_ID)

    )


    Union of all the

    SELECT

    Decode (cla.r_description, 'Central région', 'CR', 'Southern', 'SR', "Northern Region", 'NR', 'Region of Mehran', 'SIR', 'Quetta HO', 'QHO') as a region.
    ''''|| TO_CHAR (trx.trx_number) as challan_Num,
    St.Account_Number as Roll_Number,
    St.party_name as Student_Name
    CLA.class_name: '-' | St.section as Class_Section,
    period.period_name as Fee_Period,
    pay. TRX_DATE as Issue_date,
    pay. End_date as end_date,
    Pay.due_date as valid_date,
    Amount pay.amount_due_remaining

    Of
    ra_customer_trx_all trx,
    St the_city_school_students,
    class_v_table cla,
    period of bill_period
    ar_payment_schedules_all pay
    WHERE

    Trx.attribute_category = nvl(:P_CHALLAN_TYPE,trx.attribute_category)
    AND trx.attribute2 = cla.fee_structure_id
    AND trx.bill_to_customer_id = st.cust_account_id
    - AND trx.org_id = nvl(:p_org_id,trx.org_id)
    AND trx.org_id = nvl (trx.org_id, trx.org_id)
    AND trx.attribute1 = period.period_id
    AND trx.customer_trx_id = pay.customer_trx_id
    - AND cla.branch_id = NVL (: p_branch, cla.branch_id)
    AND cla.branch_id = NVL (cla.branch_id, cla.branch_id)
    AND to_char(trx.creation_date,'YYYY/MM/DD') < substr(:p_date_from,1,10)
    and pay.amount_due_remaining > 0
    and st.account_number in
    (
    SELECT distinct
    St.Account_Number as Roll_Number

    Of
    ra_customer_trx_all trx,
    St the_city_school_students,
    class_v_table cla,
    period of bill_period
    ar_payment_schedules_all pay
    WHERE

    Trx.attribute_category = nvl(:P_CHALLAN_TYPE,trx.attribute_category)
    AND trx.attribute2 = cla.fee_structure_id
    AND trx.bill_to_customer_id = st.cust_account_id
    AND trx.org_id = nvl(:p_org_id,trx.org_id)
    AND trx.attribute1 = period.period_id
    AND trx.customer_trx_id = pay.customer_trx_id
    AND cla.branch_id = NVL (: p_branch, cla.branch_id)
    AND to_char(trx.creation_date,'YYYY/MM/DD') between substr(:p_date_from,1,10) and substr(:p_date_to,1,10)
    and pay.amount_due_remaining > 0
    )

    Hello

    I see a lot of problem in your query.
    First, there is the request of duplication in Union all, who take.
    There is also the filter condition that is of no use.

    AND trx.org_id = nvl(trx.org_id,trx.org_id)
    
    AND cla.branch_id = NVL (cla.branch_id, cla.branch_id)
    

    Conditional is just out from the first query in the union. and again you choose the same lines using account_number, which is nothing else than the same thing.

    and st.account_number in
    (   SELECT distinct
         st.account_number as Roll_Number
    
         FROM
         ra_customer_trx_all trx,
         the_city_school_students st,
         class_v_table cla,
         bill_period period,
         ar_payment_schedules_all pay
         WHERE
    
         trx.attribute_category = nvl(:P_CHALLAN_TYPE,trx.attribute_category)
         AND trx.attribute2 = cla.fee_structure_id
         AND trx.bill_to_customer_id = st.cust_account_id
         AND trx.org_id = nvl(:p_org_id,trx.org_id)
         AND trx.attribute1 = period.period_id
         AND trx.customer_trx_id = pay.customer_trx_id
         AND cla.branch_id = NVL (:p_branch, cla.branch_id)
         AND to_char(trx.creation_date,'YYYY/MM/DD') between substr(:p_date_from,1,10) and substr(:p_date_to,1,10)
         and pay.amount_due_remaining >0 )
    

    so I think that under query will work

    SELECT
    decode(cla.r_description,'Central Region','CR','Southern Region','SR','Northern Region','NR','Mehran Region','MR','Quetta HO','QHO') as Region,
    ''''|| to_char(trx.trx_number) as challan_Num,
    st.account_number as Roll_Number,
    st.party_name as Student_Name,
    cla.class_name||'-'||st.section as Class_Section,
    period.period_name as Fee_Period,
    pay.TRX_DATE as Issue_date ,
    pay.DUE_DATE as due_date,
    pay.due_date as valid_date,
    pay.amount_due_remaining amount
    FROM
    ra_customer_trx_all trx,
    the_city_school_students st,
    class_v_table cla,
    bill_period period,
    ar_payment_schedules_all pay
    WHERE
    trx.attribute_category = nvl(:P_CHALLAN_TYPE,trx.attribute_category)
    AND trx.attribute2 = cla.fee_structure_id
    AND trx.bill_to_customer_id = st.cust_account_id
    AND trx.org_id = nvl(:p_org_id,trx.org_id)
    AND trx.attribute1 = period.period_id
    AND trx.customer_trx_id = pay.customer_trx_id
    AND cla.branch_id = NVL (:p_branch, cla.branch_id)
    AND (
         (trx.creation_date between TO_DATE(substr(:p_date_from,1,10),'YYYY/MM/DD') and TO_DATE(substr(:p_date_to,1,10),'YYYY/MM/DD'))
              OR
         (trx.creation_date < TO_DATE(substr(:p_date_from,1,10),'YYYY/MM/DD'))
         )
    and pay.amount_due_remaining >0
    UNION ALL
    select
    decode(A.r_description,'Central Region','CR','Southern Region','SR','Northern Region','NR','Mehran Region','MR','Quetta HO','QHO') as Region
    ,acd.ADM_CHALLAN_NO as challan_Num
    ,bsr.STUDENT_REGISTRATION_NO as Roll_Number
    ,bsr.STUDENT_NAME as Student_Name
    ,bc.CLASS_NAME as Class_Section
    ,' ' as Fee_Period
    ,acd.ADM_ISSUE_DATE as Issue_date
    ,acd.ADM_due_DATE as due_date
    ,acd.ADM_due_DATE as valid_date
    ,(ac.original_total+ac.adm_original_optional_total) amount
    from bill_student_registration bsr
    , adm_challan ac
    , adm_challan_detail acd
    , bill_class bc
    , branch_network_region_link a
    where
    ac.STUDENT_REGISTARTION_ID = bsr.STUDENT_REGISTRATION_ID
    AND bc.CLASS_ID = bsr.REGISTRATION_CLASS_ID
    AND a.BRANCH = bsr.BRANCH_ID
    AND ac.adm_challan_id = acd.adm_challan_id
    ---and ADM_PAID = 'N'
    AND bsr.ORG_ID = nvl(:p_org_id,bsr.ORG_ID)
    AND bsr.STUDENT_REGISTRATION_DATE between TO_DATE(substr(:p_date_from,1,10),'YYYY/MM/DD') and TO_DATE(substr(:p_date_to,1,10),'YYYY/MM/DD')
    AND decode(A.r_description,'Central Region','CR','Southern Region','SR','Northern Region','NR','Mehran Region','MR','Quetta HO','QHO') is not null
    AND bsr.BRANCH_ID = NVL (:p_branch, bsr.BRANCH_ID);
    

    Hope this helps

    Thank you!!!
    Didier

  • I seems to have lost the window "cut all my photos" by sending a photo. This of course means that the pictures take more time to download and use a lot of my internet time. Any help please?

    I tried to fix this feature running again the installation disc.  However if I had continued with that Ihad completely and then reinstall XP and I didn't do

    Hi iriskitchen,

    ·         What email program are you using?

    ·         What is Microsoft Outlook? If so, which version?

    Check out the following link and see if it helps.

    Reduce the size of pictures and attachments - Outlook - Office.com

    If this is related to Microsoft Office Outlook, then I would suggest that you post your question once again on the forums of Microsoft Office Outlook here.

    If this isn't the case, reply with more information, so we can help you best.

Maybe you are looking for

  • Returns

    Hello! I ordered a 7 sillicone iPhone a few days previously in Miami (it is supposed to arrive tomorrow) and yesterday, I decided to send it back. I live in the Venezuela and I would return when I get to get to US, so I don't have to worry about my f

  • Satellite L670 series keyboard problem

    Hello I have a TOSHIBA L670-11Z computer and 16 other people on a [french forum | http://forum.hardware.fr/hfr/OrdinateursPortables/Composant/defectueux-portable-satellite-sujet_58317_1.htm#t1186048].We all have the same problem with keyboard.When we

  • HP compact presario CQ77: DRIVER PCI

    Please I need help with my PCI device driver that is been uninstalled since I formatted my system. my laptop is hp compact presario cq57 with win7. my hardware ID are PCI\VEN_10EC & DEV_5209 & SUBSYS_3577103C & REV_01PCI\VEN_10EC & DEV_5209 & SUBSYS_

  • Windows Media Player cannot burn DVDs

    Original title: I have Windows XP Pro, I am trying to burn DVDs on Windows Media Player, unfortunately I can not! Windows Media Player can only burn VCD only and not DVD? Can you please teach me the steps?

  • printer does not work, test connection,

    connection tested and taken, tried to print says error, even with scannner