Article Preview
Buy Now
| Print: | |
| PDF: |
Databases for Real
REALSQLDatabase (SQLite)
Issue: 4.6 (July/August 2006)
Article Description: No description available.
Article Length (in bytes): 2,339
Starting Page Number: 36
RBD Number: 4613
Resource File(s): None
Related Link(s): None
Known Limitations: None
Excerpt of article text...
Last time we looked at the many commands for manipulating data. Once you have a lot of data loaded, you should consider adding some indexing in order to speed up access to the data. The indexing commands are listed in Table 1.
Adding an Index
An index is essentially a quick way to look up data in a table. Indexing is added to specific columns in a table. The command to add an index is simple:
CREATE INDEX URLIndex ON bookmark (URL)
This command creates an index for the URL column on the bookmark table. Your index names should be unique across the entire database.
Before you go all crazy adding indexing to all your columns, remember that you should only index columns that are used to look up information. If you rarely run a query that uses URL in the WHERE clause to look up data then an index will not help.
Indexing does not give you performance improvements for free. Adding an index will cause your database size to increase and could also slow down some database operations, particularly inserting large amounts of data. Use indexing judiciously.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|








