[SQL] Trigger efficiency

2006-02-06 Thread Josep Sanmartí
Hi, I've the following problem and I don't know how to solve it: There is a table with about 10-12 fields, a couple of those fields are updated very often (about 30 times / minute or even more). This is my table (more or less): crete table monitor( time Timestamp, time2 timestamp, .

Re: [SQL] Trigger on a column

2006-02-06 Thread Josep Sanmartí
on't block the insert/update/delete, you can try an "after trigger" that do all insertions once. 2006/2/6, Josep Sanmartí <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>: Hi, My trigger's running on a table that works perfectly. This trigger calls

[SQL] Trigger on a column

2006-02-06 Thread Josep Sanmartí
Hi, My trigger's running on a table that works perfectly. This trigger calls a function that inserts or modifies a row of a different table. My problem is that I need to optimize this trigger, and the only way that I've found is to fire the trigger when certain table fields are modified. I

[SQL] How to join several selects

2005-08-24 Thread Josep Sanmartí
Hello, I have a 'big' problem: I have the following table users(name, start_time, end_time), a new row is set whenever a user logs into a server. I want to know how many users have logged in EVERYDAY between 2 different dates. The only idea that I have is making several select (one for each da

[SQL] select values from interval

2005-07-04 Thread Josep Sanmartí
Hi, I've this table: am_conn(mac, user_ip, start_time, end_time). Each time a user connects with a remote server a new row is added, when the user is disconnected the end_time field is set. Now, I want to know if there is a way (sql statement) to know how many connections are up during an interva