<p>Firstly, you should avoid using the <code>id</code> field in any query (even sorting) for any purpose other than joining tables. The <code>id</code> fields are auto-generated by
PostgreSQL and different instances can have different <code>id</code> fields for the same block. It would be better to sort on <code>block_no</code> (which increments by one for each new block) or <code>time</code>.</p>
<p>It looks like your instance is an epoch or so behind.</p>

CC BY-SA 4.0
2022-07-30T00:45:36.480Z
Thank you for responding, as well as the knowledge about record id's.
RelevantData
CC BY-SA 4.0
2022-07-30T00:51:05.557Z
Only when I sort by time do I get the correct ordering now that I've tried, and in fact I see I am getting the latest block/slot after all..!
RelevantData
CC BY-SA 4.0
2022-07-30T00:32:24.113Z
2022-07-30T00:32:24.113Z
Erik de Castro Lopo
<p>Looking at the select statement in the screencap below - with the latest info also displayed from cardanoscan - I was expecting to see a direct correlation but my db-sync appears to be far behind cardanoscan? Am I querying the db incorrectly? Making an incorrect assumption or interpreting wrong, or has my db-sync simply fallen far behind?</p>
<p><a href="https://i.sstatic.net/8lJMy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8lJMy.png" alt="enter image description here" /></a></p>

<cardano-db-sync>
Is my db-sync far behind the latest block/slot?
# Is my db-sync far behind the latest block/slot?

(Asked by: username_0 on 2022-07-29)

Looking at the select statement in the screencap below - with the latest info also displayed from cardanoscan - I was expecting to see a direct correlation but my db-sync appears to be far behind cardanoscan? Am I querying the db incorrectly? Making an incorrect assumption or interpreting wrong, or has my db-sync simply fallen far behind?

[![enter image description here](https://i.sstatic.net/8lJMy.png)](https://i.sstatic.net/8lJMy.png)

**Tags:** cardano-db-sync

---

## 1 answers

### Answer by username_1 on 2022-07-30. Score: 2 | Accepted answer

Firstly, you should avoid using the `id` field in any query (even sorting) for any purpose other than joining tables. The `id` fields are auto-generated by
PostgreSQL and different instances can have different `id` fields for the same block. It would be better to sort on `block_no` (which increments by one for each new block) or `time`.

It looks like your instance is an epoch or so behind.

> **Comments:**
> **username_0**: Thank you for responding, as well as the knowledge about record id's.  
> **username_0**: Only when I sort by time do I get the correct ordering now that I've tried, and in fact I see I am getting the latest block/slot after all..!  

---

