[firebird-support] Re: Firebird Indexing problem

2015-10-23 Thread drci...@yahoo.com [firebird-support]
Hello Karol, I don't think I understand you fully. Indexed reads a hudreds of 
times faster than non indexed. And the table will have millions of records, so 
I do need them.
 "then this is cheaper to scan table (500 records) then use 400 indexed reads"

 What do you mean scan table? How do I do that? Like a stored procedure with 
for select? I don't understand, please explain.
 



[firebird-support] Firebird Indexing problem

2015-10-22 Thread drci...@yahoo.com [firebird-support]
Hi guys,
 I have a problem with indexing in FB. Heres the query
 

 select rep$log.pk, tablica_ime, client_number, time_stamp, sql_type, 
sql_query, usr
 from rep$log
 where usr <> 'REPL' and not exists
 
 (select rep$trans.pk from rep$trans where rep$trans.replicated_pk = rep$log.pk)
 

 Statistics show that rep$log has all non-indexed reads even though I've 
created an index for the usr field.
 

 What's more interesting is that if I change this line
 where usr <> 'REPL' and not exists

 to
 where usr = 'SYSDBA' and not exists
 

 all tha reads are indexed. So the problem is in the <> operation. How can I 
have indexed reads and keep the <> operation?
 

 Thank you in advance guys.
 

 



[firebird-support] Re: Firebird replication help needed

2015-10-09 Thread drci...@yahoo.com [firebird-support]
I've downloaded the FB Replicator and tryed it on my database. When I want to 
add it as a souce database  I enter path to the DB user pass and click save, 
but it gives me the following error: 

 ISC ERROR CODE: 335544323
 ERROR MESSAGE:
 file is not a valid database
 

 The problem is that it is ;). After 4-5 attampts it gives me another error 
with something about a closed DataSet. What should I do? Is there any 
documentation about it? I googled the error and ... nothing.
 

 Thank you


[firebird-support] Re: Firebird replication help needed

2015-10-09 Thread drci...@yahoo.com [firebird-support]
That doesn't help me, cos I need to install replicator on my clients and can't 
force them to pay 150$ for it. They just won't buy my software.

RE: [firebird-support] Firebird replication help needed

2015-10-08 Thread drci...@yahoo.com [firebird-support]
Hello Alan, Thank you for your answer. I will download the FB Replicator try it 
and see if it will work for me. 
 That part with the triggers i've already done. I have after I, U, D triggers 
for every table and they insert into my replication log table. The problem is 
that I used to put the sql query that was executedon the client DB on this 
table in the log and then just execute it on the server DB. But if the table 
metadata is changed, then that doesn't work anymore, cos its says can't execute 
to server because the fields in the insert do not equal to those in the table. 
So I decided insted to log only the table name, the PK of record, timestamp and 
the type of query - I U D. And if it's I, to execute insert or update on 
server. But probably when I execute them I'll have to separate them by table 
and get every field name and then value of that table and then onstruct the 
query as a string so it will be probably slow. 
 My other problem is should I do it in the C# replication app of use a script 
instead?
 Thank you again.If I have further questions I'll write.


[firebird-support] Firebird replication help needed

2015-10-08 Thread drci...@yahoo.com [firebird-support]
I am writing a two way server - client Firebird replication with a C# app and I 
am facing the following problem. I have a log table with the table name pk of 
the record and type of the query executet on it. For example if in the sales 
table there has been inserted a line with primery key of 4 there will be the 
table name, pk of the record and insert. My idea is if the statement is insert 
to take every value from the client's DB and insert it into the server's. How 
do I do this and how to do it so that it can work fast. Should I devide every 
record by tables and select all unreplicated records from that table or there 
is some other way. Please help me.
 
 By the way I used the method where every query that has been executed is 
written in a fild in the log table, but that makes it impossible to add columns 
to the table, cos the query will be wrong. Please help me. I've been strugling 
to write a good replication for years.