Re: [pysqlite] database locked

Rich Shepard <[email protected]> Tue, 27 May 2008 08:13:10 -0700 (PDT)
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
On Tue, 27 May 2008, Eric S. Johansson wrote:

> I know that SQL light can have multiple tables in one file which contains
               ^^^^^^^^^

   The name of the library is SQLite.

> The question should have been, if I have relatively large data sets, would
> I be better off having all of my data sets in one database or, having one
> data set per database?

   Are the two data sets related or totally independent?

> I understand that.  I have implemented it on various occasions.  The question
> is, is there any performance/locking advantage in letting SQL light do the
> sorting and narrowing of the data returned as compared to a relatively simple
> selection and letting the application program do the sorting and choosing the
> first N records.

   You'll probably find it quicker to use the SQL statements to order the
results, and you can limit the returned set to a certain number of rows.
But, that depends on how you're accessing the tables and the form of the
query. YMMV.

> I haven't read the SQL light book but the other SQL books I have read, at
> best, put me the Way back machine and send me to the 1970s.  I'm serious,
> most SQL books are just horrific.  As a rule, they contain the muddiest
> explanations and worst writing I've ever seen.  I think COBOL books were
> clearer than SQL books.

   Then you're looking at the wrong books. Read Rick van der Lans'
"Introduction to SQL, 4th edition" and Joe Celko's books, particularly "SQL
for Smarties, 3rd edition." Joe's been writing on SQL and RDBMS since at
least the early 1980s.

   There are two aspects of SQL that you might find very helpful to learn.
The first is the DDL (Data Definition Language). The DDL describes the
schema (tables and attributes) and usually includes instructions on how to
normalize data for efficiency. The second aspect is the DML (Data
Manipulation Language) which is based on the central command, SELECT.

   FWIW, I started reading SQL and RDBMS books in the early 1980s and found
most to be very well written and useful. But, I also looked through them to
find the ones that were most acceptable to me. Also, there's nothing wrong
with understanding SQL from the 1970s. The fundamentals are still the same.

HTH,

Rich

-- 
Richard B. Shepard, Ph.D.               |  Integrity            Credibility
Applied Ecosystem Services, Inc.        |            Innovation
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863