BatCave: Beyond the Default View

Quite often it is desirable to change the default view slightly.  Perhaps the data needs to be sorted in a different order, or needs to be limited in some way like showing only a single user's jobs. The BatCave was designed to help you get the view of the data that you want.

Sorting Data Display

The BatCave has a default display order for every query.  If the query defines an ORDER BY clause in the query definition, that order will be used.  If there is no default, then data is sorted by the first field returned in the query in alphabetical order.  At the top of every table of data the row headers will quite often be links to redisplay the data, sorted by that column.  Let's take a look again at the Jobs_Current query display.

The Jobs_Current query does have a default ORDER BY (see Jobs_Current query definition), so the default sorting order will be based upon the spooltime descending. This places the newest jobs at the top of the list.  You'll notice in the image above that some of the column headers are orange (owner, spooled tasks, etc.), while the elapsed column is not.  The orange columns are columns that can affect the sorting of the query.  Clicking on the orange link will cause the current query to be re-executed, but with a different ORDER BY clause.  So, for example, if you'd like to see the list in order of the time spooled, click on the word SPOOLED. You should get a view like this:

Clicking a second time on the same column title will reverse the sorting order. 

Limiting the Rows

Link-Based Limiting

Sometimes the default queries return too much data.  Clicking on Jobs_Current gives us the jobs of every user.  What if I'm only interested in seeing my own jobs?  Many of the links in the display will do that data limiting for us. For example, looking at the display above, let's say I'm only interested in jobs that are owned by george.  Clicking on the name “george” in any of the jobs lines will re-execute the Jobs_Current query, however &user=george will be added to the URL.  Main.php understands certain key fields and will automatically add them to the current WHERE CLAUSE.  Let's try it.  Clicking on the george on the first line above gives us the following output:

Quite a bit more manageable display.  Now, when clicking on any of the column headers, the new WHERE CLAUSE will be remembered and the sort will only bring up data on jobs owned by george.  

So, as it turns out, having a view of my own currently running jobs might be something that I'd like to see quite often, without having to do multiple clicks every time I want to pull up that view.  Because the sorting and data limiting were reflected in the URL, you can use the browser's FAVORITES/BOOKMARKS menu to store this view.  


SQL-Based Limiting

Link-based limiting works great, IF the templates that define the output view handle the particular kind of limiting in which you are interested.  But let's say, for example, that this time I'm interested in all current jobs that are of a specific title?   For this example I'm interested in all jobs which have mtor in the title. To make this happen we have to somehow change the WHERE CLAUSE of the current query.  We could go into the admin pages and edit the query definition, however that would affect every user who tried to view Jobs_Current.  Instead, there's an easier way, and it only affects your browser.

Look at the top of the display.  You'll find an extra set of controls, right up front and center. These three options affect operation of your browser.  In fact their current state is remembered by your browser using a cookie for each entry.  If you click on Show SQL Expert the current query will be re-executed, however you'll find a new form at the bottom of the display.  It looks like this:

The SQL Expert View is now visible.  In the bottom left you'll see the WHERE CLAUSE for the current query.  On the right are two submit buttons.  The View Data button is what we're interested in right at the moment.  If we change the WHERE CLAUSE and then click on View Data, the current query will be re-executed with the new WHERE CLAUSE.  So, let's say we are interested in all current jobs, with mtor in the title.  Click in the WHERE CLAUSE box and ADD the following: AND title like '%mtor%'.  Your where clause should now look like:


And the data has now been limited to all jobs with mtor in the title.

As you can imagine, you now have complete control over the WHERE CLAUSE and can limit the data in any way you can describe in a SQL WHERE CLAUSE.  Just as in the link-based limiting, the new query is reflected in the URL, and can be stored using your browser's FAVORITES/BOOKMARKS.

Refresh Control

Looking again at the cookie controls, the second control by default indicates No Refresh.

Clicking on the up arrow changes this display to indicate Update 5 sec. Now your screen refreshes every five seconds and the current query is re-executed.  Clicking on the up arrow again changes the refresh time to 30 seconds, then 1, 5, 30, and 60 minutes.  Clicking on the down arrow decrements the time in a similar fashion.  The refresh time is a global modifier for all queries.  If you now click on Servers_Active, or any other query, it will also refresh at the current rate.


Pixar Animation Studios
(510) 752-3000 (voice)   (510) 752-3151 (fax)
Copyright © 1996- Pixar. All rights reserved.
RenderMan® is a registered trademark of Pixar.