Database Reference
In-Depth Information
Figure 10-3 . Precedence constraints
As useful as precedence constraints are, the domain of variability that they address
is fairly limited: the only conditions that can be tested are whether a task completed as
well as the success or failure of said task. In the brief example shown in Figure 10-3 ,
you can probably infer that I'm downloading one or more files from an external source,
loading the data from those files into staging tables, and then merging (upserting) the
data into a database table. Although there's nothing technically wrong here, there is
room for improvement. For example, what happens if there are no files to be pro-
cessed? In the example shown, the truncation of the staging table, the loop through the
file system to find the downloaded files (even if none exist), and the merge operation
will all be executed even if there are no files to process.
In the first job I ever held, I was responsible for, among other things, gathering
stray shopping carts from the store parking lot and bringing them back inside. My boss
once told me, “This job requires an excessive amount of walking, so do what you can
to save steps.” All these years later, that advice still holds true. Why run through extra
steps when you can simply skip past them if they are not needed? For the previous ex-
 
Search WWH ::




Custom Search