You are viewing a single comment's thread from:

RE: [SteemSQL Wrapper] Added the info about the delay to API

in #utopian-io8 years ago

Right now SteemSQL has some issues with performances because of the blockchain size and speed

Lag was not because of blockchain size or speed, but performance of the steemd node use to retrieve blocks.

Firstly, I get the creation date of the last block from SteemSQL

SELECT TOP 1 timestamp FROM Blocks WHERE timestamp >= CONVERT(date, GETUTCDATE()) ORDER BY timestamp DESC

You don't need to use WHERE clause.
The fastest way to retrieve the last block timestamp is:

SELECT TOP 1 timestamp FROM Blocks ORDER BY block_num DESC

Sort:  

Oh, thanks, updated the post and fixed the SQL.