Subject | Re: [firebird-support] Locking and disk activity |
---|---|
Author | Ann W. Harrison |
Post date | 2005-02-11T21:29:57Z |
benedicte_asselin wrote:
whether you're using SuperServer or Classic. The lock is a change to a
data page. If another connection wants to read or change that data page
while the lock is in place, then it needs to see the most recent
version. In Classic, the connection that made the change has to write
the page to disk so the other connection can read it. In SuperServer,
both connections share a cache, so the newest version is available to
both without a write.
number of round-trips between your application and the database, but it
won't affect the number of writes.
Regards,
Ann
>Yes, but only if the page is in contention, which in turn depends on
>
> i use statements like this to lock the rows I need:
> SELECT mycolumns FROM thetable WHERE thekey=? FOR LOCK
>
> do such locks involve WRITE disk activity (if I do not actually
> modify the raw)?
whether you're using SuperServer or Classic. The lock is a change to a
data page. If another connection wants to read or change that data page
while the lock is in place, then it needs to see the most recent
version. In Classic, the connection that made the change has to write
the page to disk so the other connection can read it. In SuperServer,
both connections share a cache, so the newest version is available to
both without a write.
> if I have several rows to lock at a time, may I win time by makingNo, that doesn't make any difference. Well, it makes difference in the
> a 'in (key1, key2...)' and prepare a new statement and execute it
> rather than executing several one-by-one statement?
number of round-trips between your application and the database, but it
won't affect the number of writes.
Regards,
Ann