Slow performance when you use the function

Hi all

I have a function that returns the name of the product based on a number of identifiers. I create a new table

Insert into the product
(
Name
)
Select
PRODUCT (PRODUCT_ID)
OF x_table


It works very well but there are approximately million rows in the table and preformance is incrediably slow. No idea how I could improce performace or if I have to do this another way?

Thanks in advance


CREATE OR REPLACE FUNCTION PRODUCT (P_PRODUCT_ID IN VARCHAR2)
RETURN VARCHAR2
AS
L_Name VARCHAR2 (4000);
BEGIN
SELECT NAME
IN l_name
PRODUCTS
WHERE PRODUCTID = P_PRODUCT_ID
OR PRODUCTID = P_PRODUCT_ID1
PRODUCTID = P_PRODUCT_ID2
PRODUCTID = P_PRODUCT_ID3
PRODUCTID = P_PRODUCT_ID4;

RETURN l_name;
END;
/

It would probably be best...

Insert into Product
(
Name
)
Select PRODUCTS.NAME
FROM x_table
     JOIN PRODUCTS ON (x_table.product_ID IN (P_PRODUCT_ID, P_PRODUCT_ID1, P_PRODUCT_ID2, P_PRODUCT_ID3, P_PRODUCT_ID4))

Tags: Database

Similar Questions

  • CC 2015 Illustrator crashes when you use the function "save for Web".

    CC 2015 Illustrator crashes when you use the function "save for Web".

    Hello

    We have published a 19.0.1 hotfix that resolves this problem in discussion on this topic. Please apply the patch to your creative cloud application. The creative cloud application checks the update once a day, so you may see the update immediately.  If you want to force the check for an update at the beginning please logout and log back into the creative Cloud application.

    Link to 19.0.1 release notes: https://helpx.adobe.com/illustrator/kb/illustrator-cc-2015-crash-bug-fixes-19-0-1.html

    Kind regards

    Ashutosh

    The name of the Illustrator team engineering

  • How to add the warning message when you use the function 'print' in Adobe LiveCycle Designer

    I'm trying to make the pdf document for my business that requires the addition of a warning message while everyone to use the function 'print' page...

    Does anyone know how to add the warning message about LiveCycle Designer

    Also my supervisor mentioned something using "nag" If that sounds at all

    Not in the XML code, in the case of script of pre-publication of the "print" key. If you don't have the script editor to the top on your version of designer, you can press ctrl + shift + F5 to bring it.

  • Impact on performance when you use the LONG data type

    Hi all


    Only I have a doubt about the use of LONG data type

    I use the data type LONG for some columns in a table and I created indexes on the columns separately, but these column values can be easily fit into the varchar data type.

    (Just to see the performance on this issue)

    Suppose that a common select query with WHERE condition on any of the column which has LONG data type will affect the performance of the query?

    Please explain.

    Thank you

    (1) the LONG (and LONG RAW) data types have been depricated for quite a while. Oracle has been strongly recommends that you move to 8.1.5 CLOB and BLOB data types. Why you use the LONG data type? You're still on Oracle 7?

    (2) have you tried to write a query that has a WHERE condition that refers to a LONG column? In general, you can not because it does not support the type of data LONG. For example

    SQL> ed
    Wrote file afiedt.buf
    
      1  create table a (
      2    col1 varchar2(30),
      3    col2 long
      4* )
    SQL> /
    
    Table created.
    
    SQL> select * from a where col2='abc';
    select * from a where col2='abc'
                          *
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatype
    

    LONG data types are a royal pain to work with. They also have implications on the performance of wicked on the client.

    Justin

  • How to change the search engine when you use the functionality of Firefox Home button Search?

    In Firefox itself, I have configured duckduckgo as my default search provider.

    But when I use the host Firefox search button it is always defined on google and I don't see any possibility to change that?

    I love the Firefox Home button Search (or whatever we call it) otherwise, but it's annoying that it does not use the default Firefox.

    I use the Google Launcher now.

    Hi mrt181, it is planned to use the same search engine as in firefox - however, there is a bug at the moment, so it does not apply in all situations.
    usually, it will be enough to change the default engine in firefox back once to work around the problem in the search widget and get the same as set in the browser search provider.

  • Writing bug when you use the function to import .txt (Acrobat Pro DC)

    I'm trying to redact large sections of a document using the function import .txt to select phrases or expressions. It works great, except if there is - or '. In this case, Acrobat bad reads the text file, per the screenshot below. If I copy the sentence from the PDF file and add it in the same manual, it seems in good condition. If I paste the Clipboard even in a txt and then import the text, he result is bad reading and so cannot find the phrase in the document.

    Screen Shot 2016-04-17 at 9.42.45 PM.jpg

    It seems that the TXT file was done in Word and saved in Unicode format. and used quotation marks. Quotes in general are a big problem as three different characters are used for them and corresponding can be difficult; and 4 hyphen/as of the characters.

  • Muse randomly crashes when you use the function file/image of place. And is slow!

    Hi guys,.

    I use a MacBook Pro retina i7 with 8 GB of ram. I installed version track Adobe muse and I really love the product so far, except that it blocks a lot randomly, when I sometimes use the file from the location or place the image feature. (Command-D) Muse is also slow. I have some running applications, lots of free space etc but Muse stagnates, hang out and crashes a lot.

    Is there a reason known for this? This prevents me to consider buying the program.

    Help, please

    Kind regards

    Emmanuelle

    Please see Re: Muse crashing every time the image file is added

  • How to make appear the BCC in email, when you use the function of charms, hand

    I have sent a video about skydrive to friends but could not exercise the BCC field to send emails using the e-mail of charms, share.   Please don't tell me that it went unnoticed.  Thank you.

    Hey scottfactor,

    Unfortunately copy carbon (CC) and blind carbon copy (BCC) not currently being supported by the share to the mail scenario, you can use the Windows Mail application. If you have also installed the application SkyDrive, you can do the following:

    1. Start the Mail application
    2. Compose a new message
    3. Open the App bar
    4. Select attachments
    5. In the upper left corner of the file picker, select files
    6. Scroll and select SkyDrive

    Now you can select the video that you've uploaded to SkyDrive and share with your friends!

    -Chris

  • ORA-01722: invalid number when you use the function TO_CHAR.

    Hi all
    I was using this query closely for 1 year and it worked fine.

    Select to_char (' 2012/12/23 ', ' DD/MM/YYYY') twice;

    How ever from Monday onwards it's me back with the following error.

    ORA-01722: invalid number

    The NLS_DATE_FORMAT is DD-MON-RR in my version of oracle 11g.

    Please help me with this.

    They should compare these values as values of date instead of under the form of strings. TO_DATE should be used instead of TO_CHAR.

    Published by: Saran on January 2, 2012 23:00

  • Adobe acrobat reader for windows 8.1 x 64 crash when you use the search function

    Software Adobe acrobat reader crashes on windows 8.1 x 64 when you use the search function. Please help it is extremely annoying

    Hi rikusg98319732,

    I will suggest you to perform a clean reinstall of the reader.

    Delete using the cleaning tool: Download Adobe Reader and Acrobat tool - Adobe Labs

    Install from here: http://get.adobe.com/reader/enterprise/

    Thank you

    Abhishek

  • MainStage "lag" when you use the SPACEBAR as 'play '.

    Hi all, I'm relatively new to Mainstage (V3), and I'm hoping to use it for the first time this weekend to play the extra backing with a band tracks

    The issue I'm having, is that with the SPACEBAR of laptops on 'PLAY '. It is often "lag". or simply does not start the song. I have to wait a second, then hit again, it will work.  It is almost as if in Performance mode, when you use the down arrow key to select the next song, the 'focus' is on the list of patch, and if I click in the background where are playback buttons and stop, THEN that will work. I have not, however, been able to reproduce this particular behavior on a consistent basis.

    Everyone knows the same thing? Or why it is so 'all or nothing '?

    And a question important much donor... I gave all my reading titles to the waveform appropriate the other night (so I could visually see the waveforms above the attenuator as offers of backing track model), however, once I was moving songs in a different order, which stopped working. No idea why?

    Thnaks in advance

    About the offset by hitting the space bar, a thought occurred to me.

    How Mainstage allocates 44.1/16 bit wave files used in the reading plug-in? Which means, when a song is selected, which uses, for example, to separate the 5 cases of reading, one can assume that these audio files used in that song would need to "load" first.

    Anyone know if this is how Mainstage works?

  • Satellite A500-1GL: it is advisable to remove the battery when you use the network

    I know this is a silly question but its actually something I know not so thought I would ask.

    I almost always plug my laptop into the supply line (satellite a500 1gl)
    I was wondering have you actually keep the battery installed even when using the electrical network.
    Or is it really advisable to remove the battery when you use the network?
    I didn't know if the battery should always be in place.
    Thanks for your help
    Torti

    Hello

    A few years ago it was recommended to remove the battery of the laptop if the AC adapter is plugged. What keeps the constant charge battery
    New age of batteries are better you can leave the battery in the Bay it s ok and it should not affect the performance

    However, sooner or later each battery would die it s only a matter of time, you know

  • Acer toggle display does not display when you use the Fn + F5 key secret on my Acer Aspire 5560

    What it does:

    When you use the Fn + F5 key combination on my Acer Aspire 5560, it brings up a screen changes on the laptop screen for the selection of an external monitor, I am currently using Windows 7 Ulitmate

    Before the problem:

    Display mode switch Acer existed prior to the upgrades of the drivers

    The problem:

    The toggle screen Acer does not display when you use the Fn + F5 key secret on my Acer Aspire 5560?

    Additon Information needed to solve the problem or any other information:

    I would like to know what driver or software operates the Acer toggle display Mode?

    Also where can I find this driver for computer: Acer Aspire 5560 to bring this Acer toggle display Mode function?

    Acer Toggle display Mode: this is a picture of it when you use the Fn + F5 combination:

    Thank you very much Ironfly Ace, it has worked Acer hero of the day

  • DSC-WX150 will stop recording at 03:00 minutes when you use the HDMI video output

    Hello

    I have a Sony Cybershot DSC-WX150 camera.

    When using an output HDMI cable to view the camera to a television screen, the video movie recording function to 3:00minutes exactly every time automatically stops.

    When there is no HDMI cable plugged into the camera, it records fine 20 minutes.

    I tried changing film formats, changing the power settings, camera reset the values by default, etc., but with no difference.

    Why it only record at 03:00 minute exactly mark when you use the HDMI video output? Someone knows how to fix this?

    Thank you

    Hi tight,

    Welcome to the community of Sony!

    If I understand correctly, when you use your TV as a monitor while video recording automatically stops and does not cross the entire 29 minutes. Based on your manual, it is normal for the camera when it is connected to another device via the HDMI cable. This serves as protection for the camera.

    If my post answered your question, please mark it as "accept as a Solution. Thanks_Mitch

  • When you use the brush in the development module and I have a lot less brushes to create an image, the program hangs up to what I sometimes have to use windows to complete the task.  I have ICC Intel i7 3.4 and 16 GB of RAM to operate Windows 7.  Why hang

    When you use the brush in the development module and I have a lot less brushes to create an image, the program hangs up to what I sometimes have to use windows to complete the task.  I have ICC Intel i7 3.4 and 16 GB of RAM to operate Windows 7.  Why hang up LR

    Doing a lot of brushing up on an image using Lightroom is known to have this problem. The first thing to try is to turn off the graphics acceleration (go to Preferences/Performance tab and then uncheck the box here). IF this does not help, then you can consider doing your brush in Photoshop Elements or Photoshop, instead of brushing in Lightroom.

Maybe you are looking for

  • On the opening of the contacts beach balls

    Contacts was beachballing constantly after a few manipulations (e.g., opening a contact, scroll the contacts), requiring a force quit. I removed the plist file, but the problem continues; and now it is beachballing on before opening the window displa

  • pages does not appear in my installed applications

    Recently, I've restored my air mac to the factory settings and re installed the OS X El capitan. I noticed that my 'Pages' and 'Numbers' applications were not put back in place. What should I do?

  • Icon - random rotations editor bug

    If you change the icons with the new editor of icon in 2009 of LV, I still find that my icon (or selection or layer) is when I type the letter 'r' in a layer name.  Others see this?  Should what tool I choose to avoid this?  I installed the update fr

  • Sony Xperia Z3 repair - probably cost?

    Hello This weekend, I fell in front of my Z3 Compact (glass and LCD :-(), insofar as the touch screen is now inadmissible (bar a small section below on the right) and there is a small section in the top corner which is all black. So far I can say tha

  • Design question

    http://S21.postimg.org/iml1shtiv/homepage.PNG I want to have this page on top... How can I bold part have an orange background as pictured above? take all the width... and in the middle of this text? /* * Copyright (c) 2011-2013 BlackBerry Limited. *