Can the query be tuned to make it run faster?

select distinct
A.DEPTID,
A.POSITION_NBR,
A.EMPLID,
A.EMPL_RCD_NBR,
A.EFFDT,
B.NAME,
A.EMPL_STATUS,
A.JOBCODE,
A.ANNUAL_RT,
A.STD_HOURS,
A.PRIMARY_JOB,
C.POSN_STATUS,
case when A.POSITION_NBR = ' ' then 0 else C.STD_HOURS end,
case when A.POSITION_NBR = ' ' then ' ' else C.DEPTID end
from PS_JOB A,
PS_PERSONAL_DATA B,
PS_POSITION_DATA C
where A.EMPLID = B.EMPLID
and
((A.POSITION_NBR = C.POSITION_NBR
and A.EFFSEQ = (select max(D.EFFSEQ)
from PS_JOB D
where D.EMPLID = A.EMPLID
and D.EMPL_RCD_NBR = A.EMPL_RCD_NBR
and D.EFFDT = A.EFFDT)
and C.POSN_STATUS <> 'G'
and C.EFFDT = (select max(E.EFFDT)
from PS_POSITION_DATA E
where E.POSITION_NBR = A.POSITION_NBR
and E.EFFDT <= A.EFFDT)
and C.EFFSEQ = (select max(F.EFFSEQ)
from PS_POSITION_DATA F
where F.POSITION_NBR = A.POSITION_NBR
and F.EFFDT = C.EFFDT))
or
(A.POSITION_NBR = C.POSITION_NBR
and A.EFFDT = (select max(D.EFFDT)
from PS_JOB D
where D.EMPLID = A.EMPLID
and D.EMPL_RCD_NBR = A.EMPL_RCD_NBR
and D.EFFDT <= C.EFFDT)
and A.EFFSEQ = (select max(E.EFFSEQ)
from PS_JOB E
where E.EMPLID = A.EMPLID
and E.EMPL_RCD_NBR = A.EMPL_RCD_NBR
and E.EFFDT = A.EFFDT)
and C.POSN_STATUS <> 'G'
and C.EFFSEQ = (select max(F.EFFSEQ)
from PS_POSITION_DATA F
where F.POSITION_NBR = A.POSITION_NBR
and F.EFFDT = C.EFFDT)))
or
(A.POSITION_NBR = ' '
and A.EFFSEQ = (select max(D.EFFSEQ)
from PS_JOB D
where D.EMPLID = A.EMPLID
and D.EMPL_RCD_NBR = A.EMPL_RCD_NBR
and D.EFFDT = A.EFFDT))

Repost... I'll put in the same valuable reply that Blu made last time....
Read This
HOW TO: Post a SQL statement tuning request - template posting

Similar Messages

  • How can I make the newest version of iTunes for Windows run faster?

    I know I'm not the only one when I say that iTunes is by far one of the slowest programs on my computer.  I'm running Windows 7 and running the most recent version of iTunes for Windows.  Does anyone have some tips to make it run faster and smoother?  I have Genius and Ping disabled, but I'm not quite sure what else I can do.

    The newest version of iTunes should install if you are runnig 10.7.
    Do you get any error messages?
    Allan

  • The sample rate in my code is too low. Is there a way to make it run faster?

    Dear Sir,
        I am a LabVIEW customer, and just have a question about LabVIEW.
        We are running a code of "Wirebonder Project", but find the sample rate is too low. I'm wondering if there is a way to make it run faster. (I have
    attached the code here.)
        Thank you very much!
    Yours Sincerely,
    Xian Zhang
    Attachments:
    Wirebonder_Project_Code.zip ‏169 KB

    Hi Xian,
    What system are you running this code on and are you using the LabVIEW Real-Time Module? There is a presentation online on Optimizing and Benchmarking Real-Time code with useful related links as well as other articles in the DevZone on things like Benchmarking an Application Using LabVIW Real-Time and DAQmx.
    As you can see, this is not a simple question, so take a look at the information in these links and see if you can narrow down what in your code is running slowly and how much you might be able to improve the speed.
    Regards,Stephen S.
    National Instruments
    Applications Engineering

  • How can I safely clean my Mac of old folders etc to make it run faster?er

    How can I safely clean my Mac of old folders, etc to make it run faster?

    The only real and safe way to do this is to do it manually  looking through each folder individually.
    Many third party utilities claim to clean out a hard drive of various detritus, but some times will delete data that it shouldn't  and delete any other  important data that it shouldn't have.
    The only "safe" way to accomplish what you need to accomplish is to do this manually.
    Stay away from the OS X system folder!!!!!
    Hard drive getting full?
    You can download an app called OmniDiskSweeper.
    This app will allow you to see where files maybe able to be delete are located.
    If your Mac is running a fairly recent version of OS X, here are some general guidelines.
    Follow some of my tips for cleaning out, deleting and archiving data from your Mac's internal hard drive.
    Have you emptied your iMac's Trash icon in the Dock?
    If you use iPhoto, iPhoto has its own trash that needs to be emptied, also.
    If you have images stored in iPhoto,,the only way to weed out duplicates is to do this manually.
    When you delete them, they go to iPhoto's Trash. Remember to empty this when you are done.
    If you store images in other locations other than iPhoto, then you will have to weed through these to determine what are duplicates and what isn't
    If you use Apple Mail app, Apple Mail also has its own trash area that needs to be emptied, too!
    Other things you can do to gain space.
    Delete any old or no longer needed emails and/or archive to disc, flash drives or external hard drive, older emails you want to save.
    Look through your Documents folder and delete any type of old useless type files like "Read Me" type files.
    Again, archive to disc, flash drives, ext. hard drives or delete any old documents you no longer use or immediately need.
    Look in your Applications folder, if you have applications you haven't used in a long time, if the app doesn't have a dedicated uninstaller, then you can simply drag it into the OS X Trash icon. IF the application has an uninstaller app, then use it to completely delete the app from your Mac.
    Download an app called OnyX for your version of OS X.
    When you install and launch it, let it do its initial automatic tests, then go to the cleaning and maintenance tabs and run the maintenance tabs that let OnyX clean out all web browser cache files, web browser histories, system cache files, delete old error log files.
    Typically, iTunes and iPhoto libraries are the biggest users of HD space.
    move these files/data off of your internal drive to the external hard drive and deleted off of the internal hard drive.
    If you have any other large folders of personal data or projects, these should be archived or moved, also, to the optical discs, flash drives or external hard drive and then either archived to disc and/or deleted off your internal hard drive.
    Good Luck!

  • Hi, I have a iMac Tiger running slowly, how can I make it run faster?

    Hi, I have a iMac Tiger 10.4.11 running slowly, how can I make it run faster?

    Look at what is happenning with your Mac when you run Activity Monitor.
    Macintosh-HD -> Applications -> Utilities -> Activity Monitor
    Click on the CPU tab on the lower half of the window to see how much time you are using. 
    Click on System Memory to get statistics on memory usage.  You should have some free memory. 
    When you have lots of page outs more memory will be helpful.  My entry for entry for Page ins/outs is:
    Page ins/outs: 29163/0
    Notice I have 0 pageouts which says that I am not using my harddrive for extra memory space.  Thus, I have enough memory.
    Activity Monitor has a neat feature where it can display a dynamic dock icon.  In Activity Monitor View > Dock icon > Show cpu history.
    "Reading system memory usage in Activity Monitor :"
    http://docs.info.apple.com/article.html?artnum=107918
    <a href="http://developer.apple.com/documentation/Performance/Conceptual/ManagingMemory/A rticles/AboutMemory.html#//apple_ref/doc/uid/20001880"
    >Managing Memory</a>
    See   Kappy 
    http://discussions.apple.com/message.jspa?messageID=8025223#8025223
    Problems from insufficient RAM and free hard disk space
    http://thexlab.com/faqs/lackofram.html

  • I was wondring if there is any top free app for cleaning up  the computer and make it run faster while booting, on startup and while surfing web. I am using a macbookpro  with IOS10.8.5, under chrome,safari,firefox net environment. thanks on yourhelp

    I was wondering if there is any top free app for cleaning up  the computer from malware, phinishing apps, adware, and othere malicious softwares and make it run faster while booting, on startup and while surfing web. I am using a Macbook pro  with IOS10.8.5, under chrome,safari,firefox net environment. thanks on your help

    I was wondering if there is any top free app for cleaning up ...
    There is no such thing, since the problems you are describing can have various causes. Seeking anything claiming to "clean" your Mac is asking for trouble, since all of those products are scams, whether they are "free" or not.
    If you are having trouble with your Mac, describe what it is. Be as specific as possible. For general recommendations read below.
    There will always be threats to your information security associated with using any Internet - connected communications tool:
    You can mitigate those threats by following commonsense practices
    Delegating that responsibility to software is an ineffective defense
    Assuming that any product will protect you from those threats is a hazardous attitude that is likely to result in neglecting point #1 above.
    OS X already includes everything it needs to protect itself from viruses and malware. Keep it that way with software updates from Apple.
    A much better question is "how should I protect my Mac":
    Never install any product that claims to "clean up", "speed up", "optimize", "boost" or "accelerate" your Mac; to "wash" it, "tune" it, or to make it "shiny". Those claims are absurd.Such products are very aggressively marketed. They are all scams.
    Never install pirated or "cracked" software, software obtained from dubious websites, or other questionable sources.
    Illegally obtained software is almost certain to contain malware.
    "Questionable sources" include but are not limited to spontaneously appearing web pages or popups, download hosting sites such as C net dot com, Softonic dot com, Soft pedia dot com, Download dot com, Mac Update dot com, or any other site whose revenue is primarily derived from junk product advertisements.
    If you need to install software that isn't available from the Mac App Store, obtain it only from legitimate sources authorized by the software's developer.
    Don’t supply your password in response to a popup window requesting it, unless you know what it is and the reason your credentials are required.
    Don’t open email attachments from email addresses that you do not recognize, or click links contained in an email:
    Most of these are scams that direct you to fraudulent sites that attempt to convince you to disclose personal information.
    Such "phishing" attempts are the 21st century equivalent of a social exploit that has existed since the dawn of civilization. Don’t fall for it.
    Apple will never ask you to reveal personal information in an email. If you receive an unexpected email from Apple saying your account will be closed unless you take immediate action, just ignore it. If your iCloud, iTunes, or App Store account becomes disabled for valid reasons, you will know when you try to buy something or log in to this support site, and are unable to.
    Don’t install browser extensions unless you understand their purpose:Go to the Safari menu > Preferences > Extensions. If you see any extensions that you do not recognize or understand, simply click the Uninstall button and they will be gone.
    Don’t install Java unless you are certain that you need it:
    Java, a non-Apple product, is a potential vector for malware. If you are required to use Java, be mindful of that possibility.
    Java can be disabled in System Preferences.
    Despite its name JavaScript is unrelated to Java. No malware can infect your Mac through JavaScript. It’s OK to leave it enabled.
    The same precaution applies to Adobe Flash Player. Newly discovered Flash vulnerabilities appear almost weekly.
    Beware spontaneous popups: Safari menu > Preferences > Security > check "Block popup windows".
    Popup windows are useful and required for some websites, but unsolicited popups are commonly used to deceive people into installing unwanted software they would never intentionally install.
    Popups themselves cannot infect your Mac, but many contain resource-hungry code that will slow down Internet browsing.
    If you ever receive a popup window indicating that your Mac is infected with some ick or that you won some prize, it is 100% fraudulent. Ignore it.
    The same goes for a spontaneously appearing dialog insisting that you upgrade your video player right this instant. Such popups are frequently associated with sites that promise to deliver "free" movies or other copyrighted content that is not normally "free".
    The more insistent it is that you upgrade or install something, the more likely it is to be a scam. Close the window or tab and forget it.
    Ignore hyperventilating popular media outlets that thrive by promoting fear and discord with entertainment products arrogantly presented as "news". Learn what real threats actually exist and how to arm yourself against them:
    The most serious threat to your data security is phishing. Most of these attempts are pathetic and are easily recognized, but that hasn't stopped prominent public figures from recently succumbing to this age-old scam.
    OS X viruses do not exist, but intentionally malicious or poorly written code, created by either nefarious or inept individuals, is nothing new.
    Never install something without first knowing what it is, what it does, how it works, and how to get rid of it when you don’t want it any more.
    If you elect to use "anti-virus" software, familiarize yourself with its limitations and potential to cause adverse effects, and apply the principle immediately preceding this one.
    Most such utilities will only slow down and destabilize your Mac while they look for viruses that do not exist, conveying no benefit whatsoever - other than to make you "feel good" about security, when you should actually be exercising sound judgment, derived from accurate knowledge, based on verifiable facts.
    Do install updates from Apple as they become available. No one knows more about Macs and how to protect them than the company that builds them.
    Summary: Use common sense and caution when you use your Mac, just like you would in any social context. There is no product, utility, or magic talisman that can protect you from all the evils of mankind.

  • SAP MII. Make iGrid run faster

    Hello Experts,
    While developing user interfaces based on SAP MII I am often using iGrid Display Template. I've find out that speed of iGrid reaction directly depends on its size. I understand that I should not pass large data amounts to Java applets (as iGrid), but even if iGrid has size of 10 columns to 100 rows it is downloading data very slowly..
    Is it possible to make iGrid run faster? Maybe some Java or NetWeaver configuration should be implemented?
    Any reply will be greatly appreciated!
    Thanks in advance,
    Vitaliy

    Hi Vitaly,
    I am not sure which Version of MII you are running but there is one important thing to know about using Displaytemplates like iGrids .
    In the layout section of your e.g. iGrid, you should always define the columns to use/display. If you are not doing this the query is always executed twice (first execution to determine the columns to display and second execution to get the data). I am not sure if this behaviour still exists in the latest mii versions/patches but in previous versions you could double Performance by just defining the column names. so maybe you can have a look at this.
    Best wishes,
    Roland

  • My macbook pro hard drive is 80% full, how do you "defrag" a mac to make it run faster?

    Is there a program in mac to make my macbook pro run faster? On my PC I would defrag it but on my mac, I don't know how to do it. Can someone suggest the best way to tune up my macbook pro to delete unnecessary files and make it run faster?

    joyvdk wrote:
    Is there a program in mac to make my macbook pro run faster? On my PC I would defrag it but on my mac, I don't know how to do it. Can someone suggest the best way to tune up my macbook pro to delete unnecessary files and make it run faster?
    There are no degragmenters bundled with Mac OS X, however there is iDefrag a third party defragmenter utility. That said, I highly doubt that defragmentation will bump your computer speed. According to this Apple KB article, Mac OS X is very capable at preventing fragmentation and even the way now hard drives are being manufactured circumvent the possibility of fragmentation.
    Hope this helps.

  • My iMac seems to be running slower lately. Is there anyway to make it run faster?

    My iMac seems to be running slower than when I first bought it. Is there something I can do to make it running faster? Also can anyone recommend a good antivirus software for Mac. Thanks.

    The best antivirus application is none at all, keep OS X up-to-date and educate yourself about Malware by reading Viruses, Trojans and Malware - Prevention and removal: Apple Support Communities.
    In order to speed up your iMac we need to know some basics about it first such as what version of OS X is installed, exactly which iMac you own, how much RAM it has, what size is the HD and how much free space on the HD. Without those fundamentals we would only be guessing.

  • I have a Macbook pro 2.2 GHz Intel Core i7 (2011). Will Lion, Mountain Lion or Marverick makes it run faster or slower?

    I have a Macbook pro 2.2 GHz Intel Core i7 (2011). Will Lion, Mountain Lion or Marverick makes it run faster or slower?

    Snow Leopard is still the most efficient OSX from Apple.  I have a late 2011 MBP running Lion with no performance issues.
    I suggest the following;  Install 8 GB RAM if you do not have that already.  (The best sources of Mac compatible RAM are OWC and Crucial).  The newer OSX's are trifle more RAM hungry.
    Partition your HDD and install one of the newer OSX's in the new partition and try it out.  This allows you to 'retreat' to Snow Leoprad if you find the newer OSX is not to your liking.
    Also note that the newer OSX's do not support PPC applications.  That means that there is a possibility that some of your current applications will not work and may have to be updated or replaced.
    Ciao.

  • Will an SSD make MOTION run faster?

    As it says, will it run faster?
    I'm currently on a god awful 5400rpm HDD :/
    Motion 5 is slightly slow when rendering my projects, it exports fast and all's good. However when i want to play around with my projects it's so juttery.
    Espcially when i click PLAY, it won't PLAY, it'll stutter A LOT.
    Thoughts?

    Heya Matt,
    Motion does most of its heavy lifiting with the graphics card. An SSD will technically make Motion run faster, but upgrading the gfx card will produce the best performance increase. Have you tried optimising your playback performance in the Render settings? Draft quality, quarter resolution, etc.
    Hope that helps!
    Jasper Thayer
    Apple Certified Trainer
    https://FinalCutProX.net

  • How to clean up my mac and make it run faster

    I want to know how to clean up my mac and make it run faster.. seems very bogged down lately and doesnt do stuff very fast anymore..

    macworld.com/mac-troubleshooting-what-to-do-when-your -computer-is-too-slow.
    Basically... Make sure you have enough Free Hard Drive space for your Mac to Perform as expected...
    This is what Apple has to say.
    http://support.apple.com/kb/PH10798
    More Info Here...
    ds store  >  Why is my computer slow?
    Thomas A Reed  >  Mac Performance Guide
    To keep your Mac Happy... See Here...
    http://support.apple.com/kb/HT1147
    http://www.thexlab.com/faqs/maintainingmacosx.html
    Mac OS X: About background maintenance tasks

  • How can the query results include null if it's a required field on the front end?

    I executed a query that simply asked for all data points on a single table.
    I am trying to figure out why the query would report back as having all "Null" values in 3 of 10 columns. The information is required for the end user to enter before the system allows
    them save a record.

    You understand correctly.
    When you look up de service code do you get an description from table DDLValues?
    THIS IS CORRECT
    If the service code is in there, you should check why de ID is not correct.
    I dont know what this means. Check why the "ID" is not correct? What ID?
    The DDLvalues table has no objects on which it depends. It that normal?
    This is the code for the individual services
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[IndividualService](
    [ID] [bigint] IDENTITY(1,1) NOT NULL,
    [StudentID] [uniqueidentifier] NULL,
    [DateofService] [datetime] NULL,
    [ServiceCode] [int] NULL,
    [FocusCode] [int] NULL,
    [InterventionCode] [int] NULL,
    [ClinicianID] [uniqueidentifier] NULL,
    [Schoolid] [bigint] NULL,
    [Approved] [int] NULL CONSTRAINT [DF_IndividualService_Approved]  DEFAULT ((0)),
     CONSTRAINT [PK_IndividualService] PRIMARY KEY CLUSTERED 
    [ID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_aspnet_Users] FOREIGN KEY([StudentID])
    REFERENCES [dbo].[Students] ([StudentID])
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_aspnet_Users]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_aspnet_Users1] FOREIGN KEY([ClinicianID])
    REFERENCES [dbo].[aspnet_Users] ([UserId])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_aspnet_Users1]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_DDLValues] FOREIGN KEY([FocusCode])
    REFERENCES [dbo].[DDLValues] ([DDLValueID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_DDLValues1] FOREIGN KEY([InterventionCode])
    REFERENCES [dbo].[DDLValues] ([DDLValueID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues1]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_DDLValues2] FOREIGN KEY([ServiceCode])
    REFERENCES [dbo].[DDLValues] ([DDLValueID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues2]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_Schools] FOREIGN KEY([Schoolid])
    REFERENCES [dbo].[Schools] ([SchoolID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_Schools]
    GO

  • How to tune a oracle sql query to make it run faster ...

    Hi Guys,
    I am very new to this tuning of sql queries. It is taking a lot of time to run a query and give the output. I have a tool called TOAD[ Tool for oracle application development ] and i ran a query in that tool. Its showing that the query is taking 7sec to get its output. I donno the exact procedure what to follow in order to tune that query. What are these actually like : explain plan, sqltrace, tkprof and how to use these to tune the query. I want my query to run faster like in msec.
    Help Appreciated.
    Thanks

    http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96533/toc.htm
    http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96533/sqltrace.htm#1018

  • Any settings that can be adjusted to make everything run faster with Mountain Lion

    Hello,
    Does anyone know of any settings or adjustments that can be tweeked to make my machine run faster with Mountain Lion?
    Thanks, Jason

    yes you can do it yourself - it's actually a simple upgrade - i use a ssd in my macbook and have the RAM maxed out to 16GB.
    as for what brands should you consider, here are some good ones.
    Sandisk Extreme - Currently the fastest one out there.
    Kingston HyperX - Second fastest - this is what I have in my 13 Inch Late 2011.
    Samsung 830 series - Fast and uses less battery power - this is what's installed in the Macbook Retina.
    Crucial M4 - Also a fast SSD - I have the 512GB installed in my 15 inch Late 2011.
    If you decide to install one of these ssd in your Macbook - let me know if you need a step by step on how to clone your drive.
    Good luck..

Maybe you are looking for