内容简介
· · · · · ·

Each chapter in this book helps you identify, explain, and correct a unique and dangerous antipattern. The four parts of the book group the antipatterns in terms of logical database design, physical database design, queries, and application development.

The chances are good that your application's database layer already contains problems such as Index Shotgun , Keyless Ent...

Each chapter in this book helps you identify, explain, and correct a unique and dangerous antipattern. The four parts of the book group the antipatterns in terms of logical database design, physical database design, queries, and application development.

The chances are good that your application's database layer already contains problems such as Index Shotgun , Keyless Entry , Fear of the Unknown , and Spaghetti Query . This book will help you and your team find them. Even better, it will also show you how to fix them, and how to avoid these and other problems in the future.

SQL Antipatterns gives you a rare glimpse into an SQL expert's playbook. Now you can stamp out these common database errors once and for all.

Whatever platform or programming language you use, whether you're a junior programmer or a Ph.D., SQL Antipatterns will show you how to design and build databases, how to write better database queries, and how to integrate SQL programming with your application like an expert. You'll also learn the best and most current technology for full-text search, how to design code that is resistant to SQL injection attacks, and other techniques for success.

作者简介
· · · · · ·

Bill Karwin has been a software engineer for over twenty years, developing and supporting applications, libraries, and servers such as Zend Framework for PHP 5, the InterBase relational database, and the Enhydra Java application server. Throughout his career, Bill has shared his knowledge to help other programmers achieve success and productivity. Bill has answered thousands of...

Bill Karwin has been a software engineer for over twenty years, developing and supporting applications, libraries, and servers such as Zend Framework for PHP 5, the InterBase relational database, and the Enhydra Java application server. Throughout his career, Bill has shared his knowledge to help other programmers achieve success and productivity. Bill has answered thousands of questions, giving him a unique perspective on SQL mistakes that most commonly cause problems.

目录
· · · · · ·

1 Introduction
1.1 Who This Book Is For
1.2 What’s in This Book
1.3 What’s Not in This Book
1.4 Conventions
1.5 Example Database
· · · · · ·
(更多)

Each password should use a different salt value to make an attacker have to generate a new dictionary table of hashes for each password. Then he’s back to square one, because racking passwords in your database takes as much time as guessing them with trial and error.
/代码内容已省略/

2014-04-16 12:39

Each password should use a different salt value to make an attacker have to generate a new dictionary table of hashes for each password. Then he’s back to square one, because racking passwords in your database takes as much time as guessing them with trial and error.

Path方式，窝几年前就这么干，看来窝不是最low的。
One weakness of Adjacency List is that it’s expensive to retrieve ancestors of a given node in the tree. In Path Enumeration, this is solved by storing the string of ancestors as an attribute of each node.
You can see a form of Path Enumeration in directory hierarchies. A UNIX path like /usr/local/lib/ is a Path Enumeration of the filesystem...

2014-04-03 16:22

Path方式，窝几年前就这么干，看来窝不是最low的。

One weakness of Adjacency List is that it’s expensive to retrieve ancestors of a given node in the tree. In Path Enumeration, this is solved by storing the string of ancestors as an attribute of each node.
You can see a form of Path Enumeration in directory hierarchies. A UNIX path like /usr/local/lib/ is a Path Enumeration of the filesystem, where usr is the parent of local, which in turn is the parent of lib.
In the Comments table, instead of the parent_id column, define a column called path as a long VARCHAR. The string stored in this column is the sequence of ancestors of the current row in order from the top of the tree down, just like a UNIX path. You can even choose / as a separator character.

In the television series Star Trek,1 “tribbles” are small furry animals
kept as pets. Tribbles are very appealing at first, but soon they reveal
their tendency to reproduce out of control, and managing the overpopulation
of tribbles becomes a serious problem.

2014-04-08 11:14

Tribbles

In the television series Star Trek,1 “tribbles” are small furry animals
kept as pets. Tribbles are very appealing at first, but soon they reveal
their tendency to reproduce out of control, and managing the overpopulation
of tribbles becomes a serious problem.

Each password should use a different salt value to make an attacker have to generate a new dictionary table of hashes for each password. Then he’s back to square one, because racking passwords in your database takes as much time as guessing them with trial and error.
/代码内容已省略/

2014-04-16 12:39

Each password should use a different salt value to make an attacker have to generate a new dictionary table of hashes for each password. Then he’s back to square one, because racking passwords in your database takes as much time as guessing them with trial and error.