Subject | Re: last record from a table |
---|---|
Author | Sergio |
Post date | 2012-01-30T20:38:32Z |
--- Alexandre Benson Smith <iblist@...> wrote:
There's a slight difference in the statics.
mine:
Reads from disk to cache = 8
Fetches from cache = 18
yours:
Reads from disk to cache = 0
Fetches from cache = 9
With 1.7 million of records I coudn't notice the speed difference, but I will use your version anyway...
> I would go for:Thanks Alexandre! I tried both and your method seems to be better...
> select first 1 MyDate from MyTable order by ID desc
> With a descending index on ID of course.
There's a slight difference in the statics.
mine:
Reads from disk to cache = 8
Fetches from cache = 18
yours:
Reads from disk to cache = 0
Fetches from cache = 9
With 1.7 million of records I coudn't notice the speed difference, but I will use your version anyway...