AWS, data engineering, sql server, talend, postgres, business intelligence, car diy, photography
Search
Monday, 26 December 2016
VAG DPF Diesel particulate filter
http://www.seatcupra.net/forums/showthread.php?t=263734
VAG DIESEL PARTICULATE FILTERS
Courtesy of David Bodily Volkswagen Technical Support Specialist
Diesel Particulate Filter (DPF)
Detailed below is important information outlining the function and features of the Diesel Particulate filter which all members of your team need to be aware of.
Diesel particulate filters are becoming more commonplace on diesel engines, particularly sizes 2.0L upwards. This is in order to reduce the exhaust emissions as required by European legislation.
The prime reason for a DPF is to reduce particulate matter entering the atmosphere. Particulate matter is found in the form of soot, which is produced during diesel combustion. The DPF traps most of the soot which would normally travel down the exhaust and into the atmosphere. The DPF can hold a certain amount of soot, but not a huge quantity and therefore it needs to go through a process called ‘regeneration’ in order to clear the soot loading. When the soot goes through a ‘regeneration’ process it will be converted to a much smaller amount of ash. The ash is non-removable. There are two types of ‘regeneration’, passive and active.
During long motorway journeys, passive regeneration will occur. This needs no intervention from the engine control unit. Due to the raised exhaust temperatures on a long journey (temperatures between 350 and 500°C), the procedure occurs slowly and continuously across the catalytic-coated (with platinum) DPF. The catalytic-coated DPF is situated close to the Engine, therefore the exhaust gas temperature is high enough (500°C) to ignite the soot particles. Due to this soot is burned-off and is converted into a smaller amount of ash.
Active ‘regeneration’ is when the ECU intervenes when the soot loading in the DPF is calculated to be 45%. The procedure lasts for about 5 – 10 minutes. Specific measures are taken by the ECU to raise the engine exhaust temperature to above 600°C, these include switching off the exhaust gas recirculation and increasing the fuel injection period to include a small injection after the main injection. The soot particles are oxidised at this temperature.
The ECU will trigger a regeneration process, if for some reason this is aborted, ie. customer slows down, stops etc, the process will be resumed when regeneration conditions are once again met, above 60km/h (38mph). This will continue for 15 minutes.
If after 2 attempts of 15 minutes, a successful regeneration has not been possible, the loading will increase. At 50% soot loading, the ECU will continue to maintain maximum exhaust temperatures of 600°C to 650°C to cause a regeneration process. The system will try to run a regeneration process for 15 minutes. If unsuccessful, the system will repeat this process for a further 15 minutes, if still unsuccessful, the DPF light on the driver display panel will then be lit.
The owners handbook states, the DPF symbol lights up to indicate that the diesel particulate filter has become obstructed with soot due to frequent short trips. When the warning lamp comes on, the driver should drive at a constant speed of at least 60 km/h for about 10 minutes. As a result of the increase in temperature the soot in the filter will be burned off. If the DPF symbol does not go out, the driver should contact an authorised Volkswagen repairer and have the fault rectified.
At 55% soot loading the DPF light is lit on driver display panel. At this point the customer should follow the advice in the handbook. If they ignore this information and continue driving the vehicle until the soot loading reaches 75% without successful regeneration, additional warning lamps will light up. At this point the customer will also be complaining of lack of power, etc.
At 75%, regeneration is still possible with the use of the VAS tester. Only when the loading is above 95%, is it necessary to replace the DPF unit.
Operating Status System Response
45% DPF Load Level 1
Normal Regeneration
50% DPF Load Level 2
Regeneration at maximum exhaust temperatures
55% DPF Load DPF lamp
Regeneration from 60 km/h onwards
("See operating manual")
75% DPF Load DPF, SYS and MI lamp
Torque limitation, EGR deactivation,
Regeneration via VAG tester only
95% DPF Load Replace the DPF Unit
The Warranty department has confirmed that if there is no fault on the vehicle and DPF regeneration has been unsuccessful due to the customers driving style and the customers failure to comply with the instructions in the handbook, DPF replacement will not be paid for by warranty.
Common causes for complaint
• Frequent short journeys – Regeneration conditions are not met.
Not recommended for sale in the Channel Islands and inner city driving.
• Customers who continue to drive the vehicle with DPF light on – Continued
driving with the DPF light on and without successful regeneration results in
excessive soot loading of the DPF, to a point where it is above 95% loaded.
At this point regeneration is not an option and replacement of the DPF is
necessary.
• Fault 18434 particle filter bank 1 malfunction – Common fault code. This does
not only relate to the DPF itself, but the entire exhaust gas handling system. This
can be caused by defective temperature sensors, pressure sensors, additive
system components (if applicable), poor connections, wiring issues, etc.
Important Information
• Before diagnosing a problem vehicle or attempting to perform an emergency
regeneration, it is important to obtain a full diagnostic log and read out relevant
measured value blocks. These MVB’s contain important information on the
condition of the DPF system and are essential in diagnosing the fault. When the
DPF light is illuminated, it does not necessarily mean that the DPF requires
regeneration. For further advice, please contact Technical Support with the
information from the diagnostic log and MVB data.
• If a problem vehicle arrives with the DPF light, the engine management light and
the emissions light on. If during your diagnosis and reading of relevant MVB’s,
you find that the soot loading exceeds 75% (but is still below 95%), an
emergency regeneration procedure must be performed with the VAS tester.
Further to this, the customer needs to be educated. They need to understand
why the lights have appeared on the dash panel. Their attention needs to be
brought to the owners handbook instructions, so that they are aware of what the
DPF light means and what to do when it appears. This should prevent
unnecessary repeat visits for regeneration purposes.
I have also found that as the car gets older 30K+ miles, you will notice that the regeneration takes place more often.
ALWAYS, check your oil before any long journey, as DPF regeneration can use a fair bit of oil.
Some questions and answers that may help;
Question: The glow plug symbol is flashing. Why? What should be done?
Answer:
The DPF regeneration has not been completed during normal driving and now DPF has reached its maximum saturation at which it can still be regenerated. The limit value depends on variant and Model Year, but is in the range of 105% - 125%.Possible causes for this are:
a.) Frequent short distance journeys, i.e. high soot loading while at the same time regeneration of the DPF does not take place because the conditions necessary were not fulfilled.
b.) Frequent interrupted regenerations, i.e. the engine was switched off during regeneration. Applies to short journey drivers who have at least fulfilled the conditions for triggering regeneration. If the glow plug light flashes, the vehicle
a.) Engine running since start for longer than 2 minutes.
b.) Calculated saturation higher than 80%.
c.) Coolant temperature over 70°C for at least 2 minutes.
d.) No DPF-relevant faults stored in system.
e.) A defined vehicle speed threshold must have been exceeded (e.g. for >80% loading, 100 km/h)
Question: Under what conditions is regeneration interrupted/ended once it has started?
Answer: Normally when regeneration has been successfully completed, or:
a.) After a maximum regeneration time (20 - 25 min.).
b.) If the engine is switched off or has stalled.
c.) If the engine is left idling for a long time (5 - 10 min.).
d.) If 1000°C is detected by the exhaust temperature sensor.
e.) If during regeneration, a fault is detected on the components relevant for combustion (injection/intake system).
If a regeneration is interrupted once started but before it has been 50% completed, the glow plug lamp flashes on the next engine start (cold or hot) and regeneration begins again once the operating conditions (see 3) have been fulfilled.
Question: How long does complete regeneration take?
a.) In the most favourable case? b.) In the least favourable case?
Answer:
a.) Under constant conditions, i.e. the exhaust temperature necessary for regeneration always lies above the required value, for example during motorway/cross-country driving, the average regeneration time is 10 minutes.
b.) Vehicle conditions such as long down-hill descents, frequent driving in the low-load range (city driving, idling) allow the exhaust temperature to fall. If the conditions for triggering regeneration were fulfilled, the active regeneration time can be extended up to 25 minutes (depending on engine type). If complete regeneration is not possible within this period, the regeneration will be interrupted.
Question: How does regeneration affect the oil life?
Answer: On each regeneration or attempted regeneration, a certain diesel fuel amount is injected into the engine oil which reduces the oil life. If the "INSP" light in the instrument cluster comes on, the engine oil is exhausted and must be changed. Failure to do so could damage the engine
Thursday, 27 October 2016
Windows Command Prompt "shortcuts"
%HomeDrive% - Opens your home drive e.g. C:\
%UserProfile% - Opens you User's Profile
%temp% Opens - temporary file Folder
%systemroot% - Opens Windows folder
Cfgwiz32 - ISDN Configuration Wizard
Charmap - Character Map
Chkdisk - Repair damaged files
Cleanmgr - Cleans up hard drives
Clipbrd - Windows Clipboard viewer
Cmd - Opens a new Command Window (cmd.exe)
Control - Displays Control Panel
Dcomcnfg - DCOM user security
Debug - Assembly language programming tool
Defrag - Defragmentation tool
Drwatson - Records programs crash & snapshots
Dxdiag - DirectX Diagnostic Utility
Explorer - Windows Explorer
Fontview - Graphical font viewer
Ftp - ftp.exe program
Hostname - Returns Computer's name
Ipconfig - Displays IP configuration for all network adapters
Jview - Microsoft Command-line Loader for Java classes
MMC - Microsoft Management Console
Msconfig - Configuration to edit startup files
Msinfo32 - Microsoft System Information Utility
Nbtstat - Displays stats and current connections using NetBios over TCP/IP
Netstat - Displays all active network connections
Nslookup - Returns your local DNS server
Odbcad32 - ODBC Data Source Administrator
Ping - Sends data to a specified host/IP
Regedit - registry Editor
Regsvr32 - register/de-register DLL/OCX/ActiveX
Regwiz - Reistration wizard
Sfc /scannow - Sytem File Checker
Sndrec32 - Sound Recorder
Sndvol32 - Volume control for soundcard
Sysedit - Edit system startup files (config.sys, autoexec.bat, win.ini, etc.)
Systeminfo - display various system information in text console
Taskmgr - Task manager
Telnet - Telnet program
Taskkill - kill processes using command line interface
Tskill - reduced version of Taskkill from Windows XP Home
Tracert - Traces and displays all paths required to reach an internet host
Winchat - simple chat program for Windows networks
Winipcfg - Displays IP configuration
ciadv.msc - Indexing Service
compmgmt.msc - Computer management
devmgmt.msc - Device Manager
dfrg.msc - Defragment
diskmgmt.msc - Disk Management
fsmgmt.msc - Folder Sharing Management
eventvwr.msc - Event Viewer
gpedit.msc - Group Policy (< XP Pro)
iis.msc - Internet Information Services
lusrmgr.msc - Local Users and Groups
mscorcfg.msc - Net configurations
ntmsmgr.msc - Removable Storage
perfmon.msc - Performance Manager
secpol.msc - Local Security Policy
services.msc - System Services
wmimgmt.msc - Windows Management
hdwwiz.cpl - Add New Hardware Wizard
appwiz.cpl - Add/Remove Programs
timedate.cpl - Date and Time Properties
desk.cpl - Display Properties
inetcpl.cpl - Internet Properties
joy.cpl - Joystick Properties
main.cpl keboard - Keyboard Properties
main.cpl - Mouse Properties
ncpa.cpl - Network Connections
ncpl.cpl - Network Properties
telephon.cpl - Phone and Modem options
powercfg.cpl - Power Management
intl.cpl - Regional settings
mmsys.cpl sounds - Sound Properties
mmsys.cpl - Sounds and Audio Device Properties
sysdm.cpl - System Properties
nusrmgr.cpl - User settings
firewall.cpl - Firewall Settings (sp2)
wscui.cpl - Security Center (sp2)
%HomeDrive% - Opens your home drive e.g. C:\
%UserProfile% - Opens you User's Profile
%temp% Opens - temporary file Folder
%systemroot% - Opens Windows folder
excel - Microsoft Excel
powerpnt - Microsoft PowerPoint
msaccess - Microsoft Access
outlook - Microsoft Outlook
ois - Microsoft Picture Manager
winproj - Microsoft Project
Sunday, 17 April 2016
Baby sleep - tip 1
If the baby is struggling to sleep after being held, a tip is to place a muslin under your T-shirt whilst the baby is being fed.
Then, when the baby is placed in their cot / basket / bed for their sleep, place the muslin in with them at the same time.
The theory is, your scent is transferred to the muslin, so when its placed in with the baby, they can smell the scent, and are tricked into thinking that they're still close to the parent, and feel secure, and so they'll sleep.
Information in this blog is from my own personal experience / observation and only for my own reference. If you find it useful, then great, buy it shouldn't be considered "gospel", and your own experience may and will differ as each baby / situation is different.
Baby Sleep cycles
Everyone has sleep cycles.
In babies, these last 45 minutes.
Babies can stir, or wake themselves up in between these cycles, and my squirm, or cry for a few seconds.
This is normal, and shouldn't be concerning.
Leave them alone, and observe.
The baby will self-settle, and drift back off to sleep.
This self-settling is a crucial, and important skill that all babies need to develop so that they remain calm and relaxed as the grow.
Information in this blog is from my own personal experience / observation and only for my own reference. If you find it useful, then great, buy it shouldn't be considered "gospel", and your own experience may and will differ as each baby / situation is different.
Baby Swaddling, self-settling
Babies often have involuntarily moments. This is normal as the muscle control is still developing.
When babies are sleeping, these movements can actually cause the baby to wake them selves, either from the jolt of their own movements, or when they hit themselves in the face.
To help with their sleep, to keep them undisturbed, simply swaddle the babies arms. This helps keep the babies warm, stops involuntarily arm movements, and gives the baby the safe reassurance, similar to when the were in the womb.
Information in this blog is from my own personal experience / observation and only for my own reference. If you find it useful, then great, buy it shouldn't be considered "gospel", and your own experience may and will differ as each baby / situation is different.
Baby feeding - bottles / teats
Bottles and teats, and blockages.
Bottles, and teats all come in different shapes, sizes.
Different sized teats means that they're designed for potentially a better, or more comfortable fit in the babies mouth.
The different "numbered" teats generally mean that the "hole" at the top is a different size. This means that they can "flow" more milk during the feed.
Generally speaking the teats are either numbered from 0 to 3, or by babies months starting from "0+", progressing to "3 months+" and so on.
Some teats have a "valve" in them (for example Tommee Tippee teats have them) to help with the "return" of air back into the bottle as the babies drinks the milk out of the bottle.
At some point during feeding your baby, you may wonder why isn't the milk being drank, even if the baby is swallowing.
This may be due to the teat nozzle becoming blocked with the milk power.
This happens, and isn't a big deal.
Simply remove the bottle from the babies mouth. With the bottle upright verticle, with the teat pointing upwards, give the bottle a gentle firm squeeze.
This is to push some air that's at the top of the bottle out through the teat nozzle.
This will effectively squirt the blockage out.
It helps if you position the nozzle close to, but not touching your own lips.
You'll then feel a gentle jet of air on your lips when the blockage has been squirted out.
Alternatively, with the bottle removed from the baby, with clean hands / fingers, give the teat nozzle a quick squeeze, or roll the nozzle between your index finger and thumb. Depending on the size of the nozzle, you may even be able to see through the opening, down into the milk.
You only want to visually inspect the nozzle, ensuring no blockage, and then squeeze the bottle again so that a jet of air hits your lips, confirming that the nozzle is clear.
Now that its clear, continue feeding your baby.
As your baby grows, and gets stronger at sucking from the bottle, blocked nozzles become less if an issue, as the baby will be able to suck any blockages from undissolved milk powder straight in during their feed.
Information in this blog is from my own personal experience / observation and only for my own reference. If you find it useful, then great, buy it shouldn't be considered "gospel", and your own experience may and will differ as each baby / situation is different.
Baby blog - feeding
Bottle feeding.
Have a baby bib / muslin ready, and perhaps a cushion to place under your arm for support.
During the first few days, the baby may appear to have "pool" the milk in their mouth when drinking. This is probably down to the fact that they're getting used to drinking larger amounts of milk in one sustained period.
Also, when born, their stomach is only the size of a plum stone, so it fills up quickly.
So, burp regularly (every 15ml) to start with.
Also, with the bottle, ensure a that its sealed around the babies mouth like a nipple would have been. This helps when the baby tries to swallow, as the milk is less likely to flow out of their mouth, and down their throat.
If the baby cries, is mildly distressed during a milk feed, it'll just be wind / air that they have swallowed during the feed.
Prop up the baby in one hand, by placing / leaning the babies chest in palm of your left hand, thumb and ring finger under each armpits, and head resting on the middle and index fingers, and rub their back with the other hand.
The majority of the babies weight will be supported by the finger and thumb that are under the armpits, and the palm of your hand, so their leaning forward into your hand if that makes sense.
Any trapped air / pocket of gas will "burble" up eventually, and the baby will burp this out.
Alternatively, you may notice that the baby passes wind during the feeding session which is also a good sign.
During a feed, the baby will often fall asleep, as the milk is soporific.
Simple massage the babies leg / foot during the feeding session, and gently push the bottle teat into the babies roof of their mouth to keep them awake / stimulated, to remind them that their still feeding, and that the bottle is still in their mouth.
As a visual queue, you can watch the babies throat as they swallow so that you can see the baby drinking.
Information in this blog is from my own personal experience / observation and only for my own reference. If you find it useful, then great, buy it shouldn't be considered "gospel", and your own experience may and will differ as each baby / situation is different.
Saturday, 9 April 2016
SQL SERVER Indexes, Clustered, Nonclustered, Covering, Include, Key Ideas
Indexes
Clustered
Nonclustered
Include
About INCLUDE
Key Ideas Review
Wednesday, 17 February 2016
Garage Door Defender setup
Thursday, 21 January 2016
Beef Bolognase
200g minced beef
1 tin of tomato
Onions
Garlic
Smoked paprika
Paprika
Worcester sauce
400ml Beef stock
Tomato puree
Large squirt of tomato sauce
Italian herbs
And a mix of:
Mushrooms
Carrots
Celery
Peppers
Courgette
Bacon
Red wine
Saturday, 9 January 2016
Quick Ministrone
Heat oil
Chop 2 red opinions, and add
Chop 3 cloves of garlic, and add
Make 750ml of chicken stock and add
Add 1 tin of chopped tomatoes
Add 1tsp of paprika
Add 1/2 tsp of smoked paprika
Add 1tsp of mixed herbs
Add 1 tin of butter beans
Add 1 large squirt of tomato paste
When the pan comes to the boil
Add 100 of snapped spaghetti and stir (the pasta can stick)
Salt, pepper
Cook till pasta is tender, then turn off the heat, and wait 5 to 10 minutes for pasta to swell.
Add handful of frozen peas to cook in the soup (via residual heat)
Thursday, 8 October 2015
Tomato Risotto
Another fool proof meal from a man that can't cook.
Tomato Risotto
Roast a lasagna dish of tomato's drizzled with olive oil, salt pepper.
In a Le Creuset dish, add 3 table spoons of rapeseed oil.
Fry 1 chopped onion
Add 225ml risotto rice, and stir until coated.
Add 3 clove's crushed garlic.
Add 750ml chicken stock (I used a chicken stock cube).
Bring to boil.
Add oregano.
Place in oven @150C for 15 minutes - check / stir, leaving the lid off.
Take out of the oven when the stock water has been absorbed, and the risotto is a rice pudding consistency.
Now stir in roasted tomatoes from the lasagna dish and add grated Parmesan, and Basil.
Wednesday, 7 October 2015
Prawn Noodle's
Boil kettle, for rice noodles (half a 400g packet)
Check the prawns have been defrosted.
Drain prawn water.
Add chilli, lime juice, small crushed clove of garlic.
Peel 6 carrots into strips.
Finely chop ¼ of a chili
Place carrots, noodles, prawns chili into bowl in that order.
Drizzle lime juice over (3 limes), and toss.
There should be lime juice at the bottom if you lift the mixture out.
Laser Infrared Thermometer AR320
Friday, 20 February 2015
SQL SERVER Reporting Services Conditional Formatting trick to format colour
Me.Value
We can use this "trick" to then quickly handle cell / font formatting.
=IIF(Me.Value < 0,"IndianRed","DarkSeaGreen")
This will be a great time saver, as it'll mean you don't have to lookup the cell name each time you want to perform a conditional format.
eg.
=IIF(ReportItems!Textbox1.Value <0, "IndianRed","DarkSeaGreen")
Tuesday, 2 December 2014
ADB Android Debug Bridge Commands
networking:
Wednesday, 26 November 2014
How to Unlock / Flash a HTC DESIRE S with a new ANDROID KITKAT ROM
Firstly, enable USB debugging, and to install from UNKNOWN sources
http://www.recovery-android.com/enable-usb-debugging-on-android.html
Next, install the HTC SYNC app on a pc
http://www.htc.com/uk/software/htc-sync/
This will install the HTC SYNC app, and also the HTC USB drivers that are needed.
Now uninstall the HTC SYNC app, but leave the HTC drivers installed.
Next, connect the phone via USB to the pc to check to see if the PC can connect to the phone, and see it as a USB drive.
Now time to download various additional files for UNLOCK, RECOVERY, and OS INSTALL
Open the following page for reference, and continue reading below.
http://androidforums.com/threads/how-to-unlock-install-recovery-and-root-with-htcdev.702090/
1) grab the ADB / fastboot files
http://www.mediafire.com/?hzf1u4bowjewhdq
2) grab a copy of the RECOVERY app
http://phandroidfourm.blogspot.co.uk/2013_03_01_archive.html
Download link at the bottom of the page is :
http://forum.xda-developers.com/attachment.php?attachmentid=926566&d=1330610421
3) grab a copy of the KITKAT rom for HTC Desire S (HTC DS) "XperiaKatsaga.zip"
http://forum.xda-developers.com/showthread.php?t=2780606
ROM:http://forum.xda-developers.com/showthread.php?t=2780606
Replace this:META-INF.zip
meta-inf link : http://forum.xda-developers.com/attachment.php?attachmentid=2794366&d=1402586347
READ THIS IF YOU WANT GOODIES:
3.1)Open the ROM zip file and replace the meta-inf folder with the attachment above.
3.2)Step 1 will give you lot of goodies and no need to flash Gapps,If you dont want goodies
3.3)step b.1 & b.2 are not compulsory but beneficial
"GOODIE STEPS" not tested with BR2 but should work
4) grab a copy of GOOGLE APS install zip "gapps-kk-20140105-signed.zip"
https://drive.google.com/file/d/0B6fG7jfMahEpUDhYRUhOVWh0TXM/edit
5) grab a copy of the superuser app from the xda thread
http://download.chainfire.eu/633/SuperSU/UPDATE-SuperSU-v2.35.zip?retrieve_file=1
6)unlock with htcdev (http://www.htcdev.com/bootloader)
TIP:
In the dropdown list select ''All other supported models'' and follow the instructions.
which will take you to "http://www.htcdev.com/bootloader/unlock-instructions"
Click through to page 2 (aka Proceed to Step 5)
(http://www.htcdev.com/bootloader/unlock-instructions/page-2)
- don't bother with downloading the fastboot binary
- you have already downloaded it via step (1) above.
7) unzip (1) somewhere, and open CMD as administrator at the unzipped folder location.
8) Type "fastboot oem get_identifier_token"
8.1) to check you have connection to the phone type (via cmd)
"adb devices"
or "fastboot devices"
9) you should now be at Step 6 on the "http://www.htcdev.com/bootloader/unlock-instructions/page-2" page.
Follow it's instructions.
Submit your device identifier token, and HTCDEV will email the unlock binary.
10) Once you've submitted the token, you'll be sent an email with your unlock key as a file attachment.
Follow the further instructions and a link to complete the Bootloader process that's in the email.
You'll be directed to flash the unlock token with a command similar to:
fastboot flash unlocktoken Unlock_code.bin
This will result in an unlocked phone.
Now, you are ready to have a RECOVERY app installed, and then the new OS, and Google Apps, and the SU app.
11) Flash a recovery
Grab "recovery.img" is inside the RECOVERY zip file that was downloaded in (2), and move it to the ADB folder, then issue the command:
via cmd>fastboot flash RECOVERY recovery.img
11.1) In HBOOT (HTC Bios) select "RECOVERY"
This will boot up the RECOVERY app that was just flashed.
11.2) Within RECOVERY
-make a backup of your stock,unrooted rom. completely optional,but a very good idea,IMO.
-wipe cache
-wipe dalvik cache
-install zip from sd card
Install the ROM (3)
Install the Google App store (4)
Install the SU app (5)
-REBOOT BACK INTO HBOOT / HTC BIOS.
12) flash root files
12.1) Within the KITKAT ROM zip file, there's a "boot.img" file
We need to flash this to the phone similar to how the RECOVERY image was flashed.
NOTE THE DIFFERENT COMMAND
via cmd>fastboot flash BOOT boot.img
Now reboot, and give the phone 10 minutes to boot up.
The screen will appear black, but give it 10 minutes - leave the phone alone.
Monday, 17 November 2014
T-SQL Logical Query Processing Phases
Logical Query Processing Phases
This section introduces the phases involved in the logical processing of a query.
I will first briefly describe each step.
Then, in the following sections, I’ll describe the steps in much more detail and apply them to a sample query.
You can use this section as a quick reference whenever you need to recall the order and general meaning of the different phases.
Listing 1-1 contains a general form of a query, along with step numbers assigned according to the order in which the different clauses are logically processed.
Listing 1-1 Logical query processing step numbers
(8) SELECT (9) DISTINCT (11)
(1) FROM
(3)
(2) ON
(4) WHERE
(5) GROUP BY
(6) WITH {CUBE | ROLLUP}
(7) HAVING
(10) ORDER BY
In most programming languages, the code is processed in the order in which it is written.
In SQL, the first clause that is processed is the FROM clause, while the SELECT clause, which appears first, is processed almost last.
Each step generates a virtual table that is used as the input to the following step.
These virtual tables are not available to the caller (client application or outer query).
Only the table generated by the final step is returned to the caller.
If a certain clause is not specified in a query, the corresponding step is simply skipped.
Following is a brief description of the different logical steps applied in both SQL Server 2000 and SQL Server 2005.
Brief Description of Logical Query Processing Phases
Don’t worry too much if the description of the steps doesn’t seem to make much sense for now.
These are provided as a reference.
Sections that come after the scenario example will cover the steps in much more detail.
- FROM: A Cartesian product (cross join) is performed between the first two tables in the FROM clause, and as a result, virtual table VT1 is generated.
- ON: The ON filter is applied to VT1. Only rows for which the
is TRUE are inserted to VT2. - OUTER (join): If an OUTER JOIN is specified (as opposed to a CROSS JOIN or an INNER JOIN), rows from the preserved table or tables for which a match was not found are added to the rows from VT2 as outer rows, generating VT3. If more than two tables appear in the FROM clause, steps 1 through 3 are applied repeatedly between the result of the last join and the next table in the FROM clause until all tables are processed.
- WHERE: The WHERE filter is applied to VT3. Only rows for which the
is TRUE are inserted to VT4. - GROUP BY: The rows from VT4 are arranged in groups based on the column list specified in the GROUP BY clause. VT5 is generated.
- CUBE | ROLLUP: Supergroups (groups of groups) are added to the rows from VT5, generating VT6.
- HAVING: The HAVING filter is applied to VT6. Only groups for which the
is TRUE are inserted to VT7. - SELECT: The SELECT list is processed, generating VT8.
- DISTINCT: Duplicate rows are removed from VT8. VT9 is generated.
- ORDER BY: The rows from VT9 are sorted according to the column list specified in the ORDER BY clause. A cursor is generated (VC10).
- TOP: The specified number or percentage of rows is selected from the beginning of
VC10. Table VT11 is generated and returned to the caller.