Re: [firebird-support] How to add previous column value to current value?

2016-04-04 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Try this: select t.name, t.data, coalesce(t.data -(select data from t1 d where d.id = t.id -1),0) from t1 t -- regards, Michał Kurczabiński

Re: [firebird-support] db corruption

2016-04-04 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Try this: gfix.exe" -mend -full -ignore -user sysdba -pass masterkey "your_corrupted_db.fdb" -- regards, Michał Kurczabiński

Re: [firebird-support] 64 bit UDF DLL problem on Windows

2017-03-29 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
This should explain: https://www.youtube.com/watch?v=yepjPiVIzPc -- pozdr, Michał Kurczabiński

[firebird-support] FB 3 add description to table/ column

2017-04-03 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Code from fb 2.5 does not work: update rdb$relation_fields set rdb$description = 'aaa' where rdb$field_name = 'new_name" and rdb$relation_name = 'table_name' Update operation is not allowed for system table rdb$ralation_fields FB 3.0.2.32692 -- pozdr, Michał Kurczabiński

Re: [firebird-support] Re: firebird 3.0 ten times slower than 2.5 ?

2017-03-09 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Something was wrong with database file.fdb , even after gbak restore. I deleted file for FB 3.X and recreate new database with FB 3.0.2. Now times are similar to FB 2.5. FB_3.0.2 seems to be slighty faster than 3.0.1. now: //3.0.1 SQL> select count(*) from t1; PLAN (T1 NATURAL) Current memory

Re: [firebird-support] Re: firebird 3.0 ten times slower than 2.5 ?

2017-03-08 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
In my box in isql mode ( win7_x64, dedicated ssd drive for databases) default db configuration is still difference between 2.5 and 3.0:for select first 100 * (now over 100% of time fb 2.5) //2.5 SQL> select count(*) from t1; Current memory = 34646136 Delta memory = 0 Max memory = 34728928

Re: [firebird-support] Re: firebird 3.0 ten times slower than 2.5 ?

2017-03-08 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
//2.5.7 Database header page information: Flags 0 Checksum12345 Generation 37 Page size 16384 ODS version 11.2 Oldest transaction 26 Oldest active 27

Re: [firebird-support] FIREBIRD PIVOT function or Matrix

2017-03-08 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
So write yourown udf in your favourite language or write stored procedure eg. make_crosstab(sql varchar(500)) which parse sql and create crosstab selectable procedure in fly from given sql. You will be able to select * from crosstab as in postgres. -- regards, Michał Kurczabiński

[firebird-support] firebird 3.0 ten times slower than 2.5 ?

2017-03-08 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Hi, fb 2.5.7.27050_0_x64 fb 3.0.1.32609_0_x64 same table and data: create table t1 ( id integer not null, n varchar(100)) commit alter table t1 add primary key (id) commit //now insert 10 mln recs. execute block as declare i integer; declare v varchar(100); begin i = 0; while (i <

Re: [firebird-support] Re: firebird 3.0 ten times slower than 2.5 ?

2017-03-08 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Thanks for your answer, perhaps problem is in jaybird-3.0.0-beta-3 used to connection to fb 3. My fb25 client is jaybird-2.2.12 and works fine. -- regards, Michał Kurczabiński

Re: [firebird-support] Improve remote query speed on Windows Server 2012 VPS

2017-04-14 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
With isql is same issue? I have with flamerobin on remote machine big delay, while with eg. orbada database manager there is no additional delay. -- Regards, Michał Kurczabiński

Re: [firebird-support] Improve remote query speed on Windows Server 2012 VPS

2017-04-14 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
I think it depends on how you create and maintain connection with FB -- Regards, Michał Kurczabiński

Re: [firebird-support] Re: How can one rename a table in Firebird 3.0

2017-07-13 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
>Creating of a view is an old method. Firebird 3 just prohibit hacks with > direct changes > of system tables. ALTER TABLE table_name RENAME TO new_table_name is also old method without direct hacking of system tables... -- Regards, Michał Kurczabinski

Re: [firebird-support] connecting to firebird server

2017-05-23 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
If your delphi does not support firedac connection to fb/fb3, try zeoslib ver. 7.2.1-rc (sf.net). It supports fb3 -- pozdrawiam / regards, Michał Kurczabiński

Re: [firebird-support] SELECT with CTE and LIST: Duplicates with DISTINCT and incorrect ordering in the main select

2017-05-30 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
In future beware of something like this: select cast('text' as blob)a from rdb$database union select cast('text' as blob)a from rdb$database list() returns blob... http://tracker.firebirdsql.org/browse/CORE-1345 -- regards, Michał Kurczabiński

Re: [firebird-support] SELECT with CTE and LIST: Duplicates with DISTINCT and incorrect ordering in the main select

2017-05-30 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
First thought: you should cast as varchar list expr as cast (list(distinct 'I shouldn''t duplicate') as varchar(100)), cast(list(distinct substring('Hello' from 1 for 5)) as varchar(100)) in each occurence of list -- regards, Michał Kurczabiński

Re: [firebird-support] Hierarchical SQL Query

2017-06-13 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
What about indices? Can you show PLAN of those queries ? -- Regards, Michał Kurczabiński

Re: [firebird-support] Hierarchical SQL Query

2017-06-09 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Try this: SELECT parent.name, COUNT(product.name) FROM nested_category AS node , nested_category AS parent, product WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.category_id = product.category_id GROUP BY parent.name ORDER BY min(node.lft) --

[firebird-support] Re: UDF and server crashes on linux

2017-05-02 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Maybe it will be usefull: ProblemType: Crash Architecture: amd64 Date: Tue May 2 23:55:26 2017 DistroRelease: Ubuntu 14.04 ExecutablePath: /opt/firebird-debug/bin/.debug/firebird.debug ExecutableTimestamp: 1490087772 ProcCmdline: /opt/firebird-debug/bin/.debug/firebird.debug ProcCwd: /tmp

Re: [firebird-support] Re: UDF and server crashes on linux

2017-05-04 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Problem solved. Strange behavior of lazarus 1.6.2 IDE for linux, project settings like "use ansistrings" are not correctly propagated ... I had to set it in custom fpc settings -Sh to fix this.. -- Regards, Michał Kurczabiński

[firebird-support] UDF and server crashes on linux

2017-05-02 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Tested on FB 2.5.7 and 3.02 ubuntu_x64 14.04 (two different machines); On windows fbx64 works ok. udf return integer by value. scenario: more than 2 connections to db sql : select count(*) from table where validfield(field) = 1 on each connection table with > 2 milions record udf written in

Re: [firebird-support] Firebird vs. PostgreSQL

2018-11-09 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
2018-11-07 16:33 GMT+01:00, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] : > 07.11.2018 16:28, Michal Kurczabinski michk...@gmail.com [firebird-support] > wrote: >> Firebird also doesn't support data partitioning, extended window >> functions > >On the

Re: [firebird-support] Firebird vs. PostgreSQL

2018-11-09 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
2018-11-07 19:06 GMT+01:00, Mark Rotteveel m...@lawinegevaar.nl [firebird-support] : > On 2018-11-07 16:28, Michal Kurczabinski michk...@gmail.com > [firebird-support] wrote: >> Firebird also doesn't support data partitioning, extended window >> functions > > Wha

Re: [firebird-support] Firebird vs. PostgreSQL

2018-11-07 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Firebird also doesn't support data partitioning, extended window functions -- Regards, Michal Kurczabinski 2018-11-06 14:44 GMT+01:00, Fabiano Bonin fabiano.bo...@personalsoft.com.br [firebird-support] : > Firebird doesn't support schemas. > This is the main reason I am replacing it by

Re: [firebird-support] Firebird vs. PostgreSQL

2019-03-12 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
22:51, Michal Kurczabinski michk...@gmail.com > [firebird-support] wrote: >> First thought: >> >> range/rows between unbounded preceding and unbounded following / >> current row, etc.. > > Will be added in Firebird 4 (already present in the Firebird 4 Alpha 1). >

Re: [firebird-support] Firebird vs. PostgreSQL

2019-03-12 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
2019-03-12 16:56 GMT+01:00, Mark Rotteveel m...@lawinegevaar.nl [firebird-support] > > FILTER has been implemented in Firebird 4. See "FILTER Clause for > Aggregate Functions" in the Firebird 4 beta 1 release notes, or > http://tracker.firebirdsql.org/browse/CORE-5768 Great! > Note though that

[firebird-support] distinct on list() function

2019-11-12 Thread Michal Kurczabinski michk...@gmail.com [firebird-support]
Is this old bug from FB 2.5.x or some kind of feature ? This still exists in FB 3.x with cte as (select 1 cnt from rdb$database union all select 2 from rdb$database ) select list(cnt) from cte union select list(cnt) from cte -- Regards, Michał Kurczabiński