Subject | Re: [firebird-support] Refactoring database |
---|---|
Author | Ann W. Harrison |
Post date | 2010-01-04T17:33:38Z |
Steve Boyd wrote:
updated record doesn't fit on the original page, it will be fragmented
and the first segment will stay on that page so index references stay
the same.
reducing the size of the indexed records would outweigh the cost of
retrieving a second record.
change to the contents of the blob has been committed. You might catch
that error and refresh the record. A problem with very large VARCHAR
fields is that the run-length compression algorithm uses a byte for the
length of the repeated character, so an empty 32K VARCHAR takes ~500
bytes - if my calculation is correct. (Which is rare.) Which means
that if your comment or instruction is 500 bytes, it takes almost twice
that amount of space.
Ann
>If the value doesn't change, the index won't be updated. If the
> 1. How smart is Firebird about updating the indices when I change the
> value of the row's data? I am assuming that if the value of the
> columns comprising a particular index don't change and the updated
> row still fits into the same page then the corresponding index
> would not need to be updated. Is this correct?
updated record doesn't fit on the original page, it will be fragmented
and the first segment will stay on that page so index references stay
the same.
> 2. Since the value of the indexed columns tends to changeRows aren't moved. I'm not convinced that the gain in performance by
> infrequently compared to other columns in the table, would I be
> better off creating two tables? One for the index data and one
> for the rest. The index table could be updated via trigger only
> when the value of any of the indexed columns changes. I am
> thinking that the searches would be faster if the rows being
> search were physically smaller (more per page). I am also
> thinking that the indices would tend to get less fragmented since
> they wouldn't need to be updated as often when rows need to be
> moved to new pages, etc.
reducing the size of the indexed records would outweigh the cost of
retrieving a second record.
> 3. I am currently storing comments and special instructions inThe 'Invalid BLOB ID' error means that the row has been deleted or a
> BLOBs. My original thinking was that this was a quick and dirty
> way to provide unlimited capacity text fields. But the more I
> work with Firebird, the more I am thinking that imposing a limit
> to the size of the text fields and storing them as VARCHARs might
> be the way to go. BLOB I/O seems to be rather slow. Also, BLOBs
> cause problems when populating TDBGrids, since the BLOB data is
> only fetched when needed and if the original transaction is
> committed before the BLOB data is fetched by the grid you run the
> risk of 'Invalid BLOB ID' errors. Is there a "best way" to store
> random length textual data?
change to the contents of the blob has been committed. You might catch
that error and refresh the record. A problem with very large VARCHAR
fields is that the run-length compression algorithm uses a byte for the
length of the repeated character, so an empty 32K VARCHAR takes ~500
bytes - if my calculation is correct. (Which is rare.) Which means
that if your comment or instruction is 500 bytes, it takes almost twice
that amount of space.
>Best regards,
Ann