Hello,

ok, I guess I need to create a DESC index on TIMESTAMP of MY_TABLE.
I could verify this speeds it up from 1 minute to 1 second.
This works as long as MY_TABLE is a real table.
But now MY_TABLE is actually a View.

Can I created a index on a view with firebird?

BR

Matthias





On Mon, Mar 2, 2020 at 5:32 PM Matthias Winkler <spmm...@gmail.com> wrote:

> Hello,
>
> I guess this is another beginners question:
>
> I have a table with 300`000 entries.
> Each row has a separate field TIMESTAMP  with its creation data.
> Now, I query the latest 100 hundred using:
>
> select first(100) X, Y, TIMESTAMP
> from MY_TABLE
> order by TIMESTAMP DESC  -- order by takes all the time
>
> This query takes over a minute.
> Is there a way to speed this up?
>
> Background:  Infact, the next one hundred are queried remotely by the
> server and due to the long processing time my connections times out ....
>
> Any ideas?
>
> BR
>
> Matthias
>
>
>
  • [firebi... Matthias Winkler spmm...@gmail.com [firebird-support]
    • [f... Matthias Winkler spmm...@gmail.com [firebird-support]
      • ... Thomas Steinmaurer t...@iblogmanager.com [firebird-support]
    • RE... liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
      • ... Matthias Winkler spmm...@gmail.com [firebird-support]
        • ... 'Mathias Pannier (unitel)' pann...@ubsysteme.de [firebird-support]
          • ... Matthias Winkler spmm...@gmail.com [firebird-support]
            • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
            • ... 'Mathias Pannier (unitel)' pann...@ubsysteme.de [firebird-support]

Reply via email to