[firebird-support] Re: When is cache cleared on SuperServer

2016-09-11 Thread Köditz, Martin martin.koed...@it-syn.de [firebird-support]
Thank you Vlad.

That is important to know, since I'm using PHP applications with non-persistent 
connections.



[firebird-support] Re: When is cache cleared on SuperServer

2016-09-11 Thread hv...@users.sourceforge.net [firebird-support]
> ---In firebird-support@yahoogroups.com,  wrote :
 >  
 > if I remember right, SuperServer holds cached data as long as connections 
 > exist. So if the last user disconnects the FB cache is cleared. Is that 
 > correct?
 

   Yes

  
 > When I connect with Flamerobin the table MON$ATTACHMENTS shows me two other 
 > attachments: CACHE WRITER and GARBAGE COLLECTOR. 

 > Does they still exist after last log out 


   No, they finished with last user connection.

 

 > and will the cache be cleared? 

 

 sure

 

 > Do they influence the cache process? 

  Of course.

Regards,
Vlad

PS probably you will be interesting in "database linger" feature of fb3:
http://www.firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-ddl-enhance.html#rnfb30-ddl-enhance-linger
 
http://www.firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-ddl-enhance.html#rnfb30-ddl-enhance-linger

  






[firebird-support] Firebird-Nodejs: [Connection is closed] error

2016-09-11 Thread Markand Bhatt mark...@mbhatt.in [firebird-support]
Guys, I need your help to connect nodejs to firebird.


I have also posted my question on stackoverflow http://stackoverflow.com/
questions/39429372/firebird-getaddrinfo-enotfound/39433949#39433949


I use node-firebird npm package to connect.
https://www.npmjs.com/package/node-firebird


Following is my code


var Firebird = require('node-firebird');
var options = {};
options.host = 'localhost';
options.database='d:\\a.fdb';
options.user = 'sysdba';
options.password = 'sa123';


app.get('/', function(request, response) {
Firebird.attach(options, function(err, db) {
if (err)
console.log(err); //Here I get error [Connection is closed]
console.log(db);
});
});


Help me.


[firebird-support] When is cache cleared on SuperServer

2016-09-11 Thread Köditz, Martin martin.koed...@it-syn.de [firebird-support]
Hi,

if I remember right, SuperServer holds cached data as long as connections 
exist. So if the last user disconnects the FB cache is cleared. Is that correct?

When I connect with Flamerobin the table MON$ATTACHMENTS shows me two other 
attachments: CACHE WRITER and GARBAGE COLLECTOR. Does they still exist after 
last log out and will the cache be cleared? Do they influence the cache process?

Regards,
Martin


Re: [firebird-support] Optimizer request

2016-09-11 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
11.09.2016 18:39, 'Djordje Radovanovic' softsis...@sbb.rs [firebird-support] 
wrote:
> maybe to teach me how to ask this
> kind of question to not bother you with my wrong style.

   That's exactly what I wrote: whenever you ask for help with SQL queries, 
post the plan 
of the queries, not just stats.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] Optimizer request

2016-09-11 Thread 'Djordje Radovanovic' softsis...@sbb.rs [firebird-support]
Read my previous messages, maybe you'll find my desired result.
You were the first one who tried to help me and I admire that but If you do 
not like my thread, just ignore it, or maybe to teach me how to ask this 
kind of question to not bother you with my wrong style.

Thanks,

Djordje

-Original Message- 
From: Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
Sent: Sunday, September 11, 2016 11:03 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Optimizer request

11.09.2016 10:29, 'Djordje Radovanovic' softsis...@sbb.rs [firebird-support] 
wrote:
> This time instead of 1 reads of orders and 1 reads of partners I 
> received exactly
> what I was asking for.

   You'd move to desired result faster if instead of useless stats showed 
plans of the
queries.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu 
there.

Also search the knowledgebases at 
http://www.ibphoenix.com/resources/documents/

++


Yahoo Groups Links









++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



[firebird-support] Re: "nbackup needs local access to database file"

2016-09-11 Thread hv...@users.sourceforge.net [firebird-support]
---In firebird-support@yahoogroups.com,  wrote :
 
 > I am getting this error while running nbackup:
 >  

 > "nbackup needs local access to database file"
  > 
 > The nbackup sentence is:
  > 
 > Nbackup.exe -user SYSDBA -pas HereMyPass   -B  0  localhost:MyDB_FB3.fdb 
 >C:\temp \MyDB_Level_0.nbk
 >  

 > If I remove localhost: then it works, but that would be running as embebed 
 > and it is a superserver with active network connections.
 
F:\b30\output_Win32>firebird -a

F:\fb30\output_Win32>isql localhost:test_a -user sysdba -pass masterkey
Database: localhost:test_a, User: SYSDBA
SQL> shell;
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

F:\fb30\output_Win32>nbackup.exe -b 0 localhost:test_a s:\test_a.nbk -user 
sysdba -pass masterkey
time elapsed0 sec
page reads  181
page writes 181

F:\fb30\output_Win32>exit;
SQL> exit;

Regards,
Vlad

  




Re: [firebird-support] Gbak performance issues on FB3

2016-09-11 Thread fabia...@itbizolutions.com.au [firebird-support]
Ahhh, OK, thanks!!

Re: [firebird-support] Gbak performance issues on FB3

2016-09-11 Thread hv...@users.sourceforge.net [firebird-support]
Fabian,

run gbak using services (with -se switch)

Vlad

PS overquoting is BAD 

 




Re: [firebird-support] "nbackup needs local access to database file"

2016-09-11 Thread fabia...@itbizolutions.com.au [firebird-support]
Ok, but something is not right, in some instances I am getting about 1 or 2 
megabytes throughput with gbak fb3, and I am getting 150 MB throughput with 
gbak fb 2.5; the problem is so evident it cannot be just different access. It 
seems there is a bottle neck somewhere; perhaps the small changes I've made to 
the firebird.conf are affecting it substancially??? Simple changes like tcpip 
packet size to 16384 instead of 8192, more memory assigned to some resources, 
nothing creazy, like multiply by 4 changes...
  - Original Message - 
  From: Mark Rotteveel m...@lawinegevaar.nl [firebird-support] 
  To: firebird-support@yahoogroups.com 
  Sent: Sunday, September 11, 2016 5:11 PM
  Subject: Re: [firebird-support] "nbackup needs local access to database file"


  On 10-9-2016 23:34, fabia...@itbizolutions.com.au [firebird-support] wrote:
  > I am getting this error while running nbackup:
  >
  > "nbackup needs local access to database file"
  >
  > The nbackup sentence is:
  >
  > Nbackup.exe -user SYSDBA -pas HereMyPass   -B  0
  >  localhost:MyDB_FB3.fdbC:\temp\MyDB_Level_0.nbk
  >
  > If I remove localhost: then it works, but that would be running as
  > embebed and it is a superserver with active network connections.
  >
  > Any ideas?

  Gbak and nbackup are different tools that work in a different way. Gbak 
  works through a Firebird server (real or embedded), while nbackup works 
  with the physical backup file.

  Mark
  -- 
  Mark Rotteveel


  
  Posted by: Mark Rotteveel 
  

  ++

  Visit http://www.firebirdsql.org and click the Documentation item
  on the main (top) menu.  Try FAQ and other links from the left-side menu 
there.

  Also search the knowledgebases at 
http://www.ibphoenix.com/resources/documents/ 

  ++
  

  Yahoo Groups Links





Re: [firebird-support] Gbak performance issues on FB3

2016-09-11 Thread fabia...@itbizolutions.com.au [firebird-support]
Mark

Ok, I understand, but on the same server I just reverted to Firebird 2.56 and 
the gbak flies, like it works several times faster than on FB3. One more thing 
I've noticed that may help understand what is happening, on FB3 gbak uses 15x 
(15 times) aprox. more network resources that hdd resources while doing a local 
backup or restore. Obviously in FB 2.5 the network is at zero because there is 
no need to go through the localhost or ip to avoid launching the embebed 
connection (the fbk files are local on the hdd, and the database obviously is 
also local to the same server). My theory is that the issue is somewhere around 
there. Pehaps there is a way to talk to the super server without involving the 
network card? Perhaps there is a way to finetune the data flow between gbak and 
the database and the fbk creation, as it seems somewhere in the chain there is 
a delay, it seems somewhere there is a bottleneck.

I hope my long hours of debbuging are helping identify a potential issue. 

And to finish on a good note, so far with my application FB3 has not shown any 
negative behaviour when compared with FB 2.5, I am connecting via ODBC 32 bits.

Cheers,
Fabian




- Original Message - 
  From: Mark Rotteveel m...@lawinegevaar.nl [firebird-support] 
  To: firebird-support@yahoogroups.com 
  Sent: Sunday, September 11, 2016 5:09 PM
  Subject: Re: [firebird-support] Gbak performance issues on FB3


  On 10-9-2016 22:11, fabia...@itbizolutions.com.au [firebird-support] wrote:
  > I am running both gbak.exe and nbackup.exe on an FB3 server with Windows
  > 2012 R2 64 bits, 24 processor, 192 GB ram, the nbackup.exe level zero is
  > much faster than the gbak.exe (does not make any sense, it should take
  > about the same time as gbak), both running locally but connecting using
  > the super server (localhost:database_name); any ideas why gbak.exe is so
  > slow?

  Your assumption is wrong, nbackup is expected to be a lot faster than 
  gbak as it makes a physical backup of the database pages instead of a 
  logical backup of the data in the database.

  Mark

  -- 
  Mark Rotteveel


  
  Posted by: Mark Rotteveel 
  

  ++

  Visit http://www.firebirdsql.org and click the Documentation item
  on the main (top) menu.  Try FAQ and other links from the left-side menu 
there.

  Also search the knowledgebases at 
http://www.ibphoenix.com/resources/documents/ 

  ++
  

  Yahoo Groups Links





Re: [firebird-support] Optimizer request

2016-09-11 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
11.09.2016 10:29, 'Djordje Radovanovic' softsis...@sbb.rs [firebird-support] 
wrote:
> This time instead of 1 reads of orders and 1 reads of partners I 
> received exactly
> what I was asking for.

   You'd move to desired result faster if instead of useless stats showed plans 
of the 
queries.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] Optimizer request

2016-09-11 Thread 'Djordje Radovanovic' softsis...@sbb.rs [firebird-support]
This one makes significiant change.

This time instead of 1 reads of orders and 1 reads of partners I 
received exactly what I was asking for.

133 reads of parters table
1335 of orders table

Thank you Arno. Please can you explain me part on the right side of FROM? 
Somewhere in my subconsciousness I have in mind that something like this is 
doable but never read good explanation of that kind of virtual table.

Best reagrds,

Djordje Radovanovic

From: mailto:firebird-support@yahoogroups.com 
Sent: Sunday, September 11, 2016 12:11 AM
To: firebird-support@yahoogroups.com 
Subject: Re: [firebird-support] Optimizer request

  

Which Firebird version are you using?


Does this perform for you as expected:

SELECT
  * 
FROM 
  (SELECT partners.partid + 0 AS PartID FROM partners WHERE partners.country = 
'Spain') dt
  JOIN orders ON (orders.partid = dt.partid)



Kind Regards,
Arno Brinkman


From: mailto:firebird-support@yahoogroups.com 
Sent: Saturday, September 10, 2016 10:05 PM
To: firebird-support@yahoogroups.com 
Subject: Re: [firebird-support] Optimizer request




CREATE TABLE PARTNERS (
PARTID   INTEGER NOT NULL,
COUNTRY  CHAR(20)
);
ALTER TABLE PARTNERS ADD CONSTRAINT PK_PARTNERS PRIMARY KEY (PARTID);
CREATE INDEX PARTNERS_IDX1 ON PARTNERS (COUNTRY);

CREATE TABLE ORDERS (
ORDERNUM   INTEGER NOT NULL,
ORDERDATE  DATE,
AMOUNT DECIMAL(18,2),
PARTID INTEGER
);

ALTER TABLE ORDERS ADD CONSTRAINT PK_ORDERS PRIMARY KEY (ORDERNUM);
ALTER TABLE ORDERS ADD CONSTRAINT FK_ORDERS_PARTNERS FOREIGN KEY (PARTID) 
REFERENCES PARTNERS (PARTID) ON DELETE NO ACTION ON UPDATE NO ACTION;

This is tables definitions. So, index exist and after all perfomance analyzer 
gives me same result.
Perfomance analyzer was taken from IBExpert. Whatever I do (as others suggest) 
perfomance are the same. I still vote for changes in optimizer. Right side from 
WHERE clause needs to be evaluated before main query and it is simple and much 
better solution same as Oracle optimize query. 

Firebird is very kind to programmer and has easy to understand, efficient P/SQL 
and some improvements will give us significant efficiency.
.
Djordje

From: mailto:firebird-support@yahoogroups.com 
Sent: Friday, September 09, 2016 10:51 PM
To: firebird-support@yahoogroups.com 
Subject: Re: [firebird-support] Optimizer request

  

On Fri, Sep 9, 2016 at 8:30 AM, 'Djordje Radovanovic' softsis...@sbb.rs 
[firebird-support]  wrote:


  I tried query with subquery in where clause and found big issue for this type 
of subquery.

  select * from orders where orders.partid in (select partners.partid from 
partners where partners.country = ‘Spain’)

  Perfomance Analysis returns me this

  partners 687660 non index reads
  orders  28657 index reads

  If you analyze this result you’ll find that there is 687659 unnecessary non 
index reads. If developer of optimizer accept that all queries on the left side 
of where clause has priority (and there is no way to be opposite) than we have 
big improvement in optimization.

Is there an index on partners.country?  What plans are generated for each query?

If I were writing this query, I'd write

select o.* 
 from orders o
inner join partners p 
 where p.partid = o.opartid
and p.country = 'Spain';

All that silliness about "select from (select from )" probably doesn't save 
anything in
this case - it does when the inner select is complicated, but not here.  
Firebird won't
carry around unneeded fields from the partners table.

What is the distribution of partners.country?

Good luck,

Ann
  __,_._,_


Re: [firebird-support] "nbackup needs local access to database file"

2016-09-11 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 11-9-2016 09:11, Mark Rotteveel m...@lawinegevaar.nl 
[firebird-support] wrote:
> Gbak and nbackup are different tools that work in a different way. Gbak
> works through a Firebird server (real or embedded), while nbackup works
> with the physical backup file.

That should have been "physical database file".

-- 
Mark Rotteveel


Re: [firebird-support] "nbackup needs local access to database file"

2016-09-11 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 10-9-2016 23:34, fabia...@itbizolutions.com.au [firebird-support] wrote:
> I am getting this error while running nbackup:
>
> "nbackup needs local access to database file"
>
> The nbackup sentence is:
>
> Nbackup.exe -user SYSDBA -pas HereMyPass   -B  0
>  localhost:MyDB_FB3.fdbC:\temp\MyDB_Level_0.nbk
>
> If I remove localhost: then it works, but that would be running as
> embebed and it is a superserver with active network connections.
>
> Any ideas?

Gbak and nbackup are different tools that work in a different way. Gbak 
works through a Firebird server (real or embedded), while nbackup works 
with the physical backup file.

Mark
-- 
Mark Rotteveel


Re: [firebird-support] Gbak performance issues on FB3

2016-09-11 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 10-9-2016 22:11, fabia...@itbizolutions.com.au [firebird-support] wrote:
> I am running both gbak.exe and nbackup.exe on an FB3 server with Windows
> 2012 R2 64 bits, 24 processor, 192 GB ram, the nbackup.exe level zero is
> much faster than the gbak.exe (does not make any sense, it should take
> about the same time as gbak), both running locally but connecting using
> the super server (localhost:database_name); any ideas why gbak.exe is so
> slow?

Your assumption is wrong, nbackup is expected to be a lot faster than 
gbak as it makes a physical backup of the database pages instead of a 
logical backup of the data in the database.

Mark

-- 
Mark Rotteveel