04.02.2020 12:36, Matthias Winkler spmm...@gmail.com [firebird-support] wrote:
> The PRIMKEY is ASC and unique.
For this query it must be DESC.
> Is the another way to achieve the same?
What's the purpose of it? Unique id generation used to be handled by
generators.
--
WBR, SD.
---
Just create a descending index,
Set
tir. 4. feb. 2020 kl. 12:36 skrev Matthias Winkler spmm...@gmail.com
[firebird-support] :
>
>
> Hello,
>
> I am struggling with my DB performance once more:
>
>SELECT FIRST(1) PRIMKEY
>FROM TABLE_X
>ORDER BY PRIMKEY DESC
>
> The statement is slow on
The purpose of the code is:
The last entry is considered the "current" entry and should be updated
when the programm encounters e.g. a error.
(Then the field error_count of the "current" entry is then incremented)
On Tue, Feb 4, 2020 at 12:40 PM Svein Erling Tysvær setys...@gmail.com
[firebird-su
04.02.2020 12:42, Matthias Winkler spmm...@gmail.com [firebird-support] wrote:
> The last entry is considered the "current" entry and should be updated
> when the programm encounters e.g. a error.
> (Then the field error_count of the "current" entry is then incremented)
That's a bad design. The
Hi SD,
no doubt, that might be solved better or more performant.
But I need to deal with a heap of old code and re-designing
it, is not a real option :-)
On Tue, Feb 4, 2020 at 12:45 PM Dimitry Sibiryakov s...@ibphoenix.com
[firebird-support] wrote:
> 04.02.2020 12:42, Matthias Winkler spmm...@
04.02.2020 12:47, Matthias Winkler spmm...@gmail.com [firebird-support] wrote:
> But I need to deal with a heap of old code and re-designing
> it, is not a real option :-)
Still you can use "update or insert ... matching gen_id(..., 0)" instead.
--
WBR, SD.
-
Hello SD,
YES That kind of thing is what I was looking for, I guess.
Thanks
On Tue, Feb 4, 2020 at 12:52 PM Dimitry Sibiryakov s...@ibphoenix.com
[firebird-support] wrote:
> 04.02.2020 12:47, Matthias Winkler spmm...@gmail.com [firebird-support]
> wrote:
> > But I need to deal with a heap o
I fixed the update statement with
"UPDATE ... where PRIMKEY= GEN_ID(gen_primkey_counter,0)"
and execution fell from 20s to 0,4. :-)
Now a final question, what would GEN_ID(gen_primkey_counter,0) return,
when I delete the last n entries of the table?
It's fun to implement FB with such a great an
Hello.
Try using a "WHERE" clause if possible.
Ex: WHERE "some_date_column_of_the_table" > (current_date - n)
Atenciosamente,
+ + Hugo Eyng + +
De: firebird-support@yahoogroups.com em nome
de Matthias Winkler spmm...@gmail.com [firebird-support]
Enviado: ter