|
|
6 of 7 people found the following review helpful:
3.0 out of 5 stars
voluminous and uneven, November 7, 2005
Sybase Transact SQL Programming Guidelines and Best Practices A Practitioners Approach through Example. (Mich Talebzadeh and Ryan Thomas Putnam)
Like its title, this is a long book; it encompasses 32 chapters and 9 appendices in 750 pages. Despite its title, it is intended for database designers and administrators as well as programmers. The authors appear to be consultants and, judging by their examples, work primarily in the financial arena. The book covers a wide range of Sybase features and includes some functionality as recent as ASE 12.5.2.
The first five chapters briefly cover batches, indexes, fragmentation, search arguments, and, to a limited degree (e.g., only one form of the case statement is listed), best practices. Chapter six addresses tempdb in detail. A short chapter on sort operations is followed by a long one on query tuning. Considerable coverage on reading showplan output is provided. Next are cursors, including a welcome section on alternatives (although the read-only example does not follow their best practice of checking @@SQLSTATUS after the last fetch), joins (but not outer joins), and isolation levels. The next three chapters address locking issues, followed by stored procedure and trigger chapters. After a detour to showplan, optimizer hints are discussed. The various datatypes are listed followed by control-of-flow logic, remote procedure calls, the execute immediate statement (mentioned with disfavor), and key generation (both sequential and random). Functions used with various datatypes are next. Code examples for computing medians, modes, means, and variances are presented. (However, the claim that "calculating any nth percentile is very easy within ASE" would seem to pale in comparison with builtin functions in other DBMSs.) Next the authors cover data purging/archiving, login triggers, and fine grain access control (with another trashing of dynamic SQL). Their techniques of error handling and exception reporting comprise the final chapter. If you are not exhausted by now, you can continue with the appendices on language fundamentals, Transact SQL compilation, variables, functions (again!), global variables, set commands, the authors' favored views (voluminous), sending mail, and determining fragmentation.
Obviously, this book contains a lot of material. What mainly separates this book from others is the authors' presentation of their specialized SQL and UNIX shell code. The chapters on statistical measures, error handling, and exception reporting as well as the code on determining index fragmentation are also not easily found elsewhere. Conversely, some of the chapters (on Query Tuning and Datatypes) and appendices (Functions, Global Variables, and Set Commands) basically appear to be cut-and-pasted from the Sybase documentation. They also appear to have some redundancy.
Other detriments appear to be an above-average number of technical and grammatical errors. For example, the clause on page 44 should be "group by op_services_run_id", not "group by count (op_services_run_id)". "Shared level locks do prevent others from reading ..." on page 251 is one of several obvious errors. The authors indicate that a second edition will be more carefully proofread.
Some of the best practices appear dubious to my subjective eyes. The group by clause is split onto two lines as is every column name and value in an insert statement (e.g., page 338). The authors favor views and disfavor dynamic SQL. The latter preference basically leads them into code parameterization at the shell level. The lengthy Korn shell in Appendix I demonstrates how to determine fragmentation from the UNIX level. The reviewer has not used this script but it appears as if it could be done just as well with dynamic SQL and "sp_" stored procedures.
If you want to have a single "generic reference book" instead of the Sybase manuals (Transact-SQL Guide, Reference Manuals, and Performance & Tuning Guides) and can recognize some obvious mistakes, then this text may fit your needs.
|