There is equipment that every 1-2 seconds (if everything is normal) sends a package of 4 fields. This package is saved to the database log-table (each package is a separate record). In addition, it is necessary for the client to ensure that the data of the last packet is displayed.
How to do it better? Request
SELECT * FROM packets WHERE device_id = :id HAVING id = MAX(id) or last_packets table and regularly updating this table? (log table is needed anyway)
DBMS Orakl. The number of such devices is up to 200.
And another point - if at the moment of receiving the package the client is connected to the server, then the package is sent directly to this client. Those. the client does not need to constantly contact the database. Access to the last packet is needed when the equipment has ceased to transmit data, and at the time of the transfer the client was absent
WHERE ROWNUM = 1condition in the outer query? - Anton Shchyrovidguaranteed to increase, then why not? And then, it is optional to sort byid, by date it is also possible. If the index is, it should also be used, then the speed will almost not depend on the size of the table. - Dmitriy