Re: [firebird-support] Force query plan to filter before join

2012-02-20 Thread Alec Swan
Hello Set, Your guesswork worked quite well. Your query executes 20 times faster than my original query! Here are the stats for your query: PLAN SORT (JOIN (JOIN (JOIN (SORT (TMP P NATURAL), PCD INDEX (FK_zDTEgB/EMb14zlRjEdzCZw==)), CC INDEX (IDX_epDQN2rI7u0hoaXiWuFXAw==)), JOIN (C INDEX (PK_ZM6SR

[firebird-support] how to retrieve Stat of a executed SQL ?

2012-02-20 Thread nathanelrick
Hello how to retrieve the stat of a just executed SQL ? i do like this but seam to not work : SELECT FIRST 1 SKIP 1 /* skip 1 because last statement is THIS statement */ MON$RECORD_IDX_READS as IDX_READS, MON$RECORD_SEQ_READS as SEQ_READS FROM MON$RECORD_STATS JOIN MON$STATEMENTS

[firebird-support] Re: how to optimize this query ?

2012-02-20 Thread nathanelrick
ok thanks seam to work (but i don't know how is is internally optimized) ... but seam ok! --- In firebird-support@yahoogroups.com, Svein Erling Tysvær wrote: > > >oops, now i have another probleme > > > >Select > > First 10 > > MAINTABLE.ID > >from > > MAINTABLE > >where > > (MAINTABLE.

Re: [firebird-support] Re: lock the table "partially"

2012-02-20 Thread Ann Harrison
On Mon, Feb 20, 2012 at 5:15 AM, nathanelrick wrote: > > Now time to time i need to reset the calculation for one particular product, > so i simply launch a query that count all item and set the item_count of the > product ... but of course during this calculation, no one must be able to add >

AW: [firebird-support] character set

2012-02-20 Thread Olaf Kluge
Hello, > we have some problems by inserting data into an table. In our case, the > customer inserts characters in a field varchar(XX) with special character > “°”. This little ° with character set iso8859_1 and collation de_de by > inserting generates a gds-exception error: 335544321 arithm

Re: [firebird-support] character set

2012-02-20 Thread Stefan Heymann
> we have some problems by inserting data into an table. In our case, the > customer inserts characters in a field varchar(XX) with special character > “°”. This little ° with character set iso8859_1 and collation de_de by > inserting generates a gds-exception error: 335544321 arithmetic exception,

Re: [firebird-support] character set

2012-02-20 Thread Mark Rotteveel
On Mon, 20 Feb 2012 14:18:25 +0100, "Olaf Kluge" wrote: > Hallo, > > > > we have some problems by inserting data into an table. In our case, the > customer inserts characters in a field varchar(XX) with special character > “°”. This little ° with character set iso8859_1 and collation de_de by

[firebird-support] character set

2012-02-20 Thread Olaf Kluge
Hallo, we have some problems by inserting data into an table. In our case, the customer inserts characters in a field varchar(XX) with special character “°”. This little ° with character set iso8859_1 and collation de_de by inserting generates a gds-exception error: 335544321 arithmetic excepti

[firebird-support] Re: how to optimize this query ?

2012-02-20 Thread Svein Erling Tysvær
>oops, now i have another probleme > >Select > First 10 > MAINTABLE.ID >from > MAINTABLE >where > (MAINTABLE.name = 'jean') >ORDER BY MAINTABLE.DATE > >UNION > >Select > First 10 > SECONDTABLE.ID >from > SECONDTABLE >where > (SECONDTABLE.name = 'jean') >Order by SECONDTABLE.DATE >

[firebird-support] Re: how to optimize this query ?

2012-02-20 Thread nathanelrick
oops, now i have another probleme Select First 10 MAINTABLE.ID from MAINTABLE where (MAINTABLE.name = 'jean') ORDER BY MAINTABLE.DATE UNION Select First 10 SECONDTABLE.ID from SECONDTABLE where (SECONDTABLE.name = 'jean') Order by SECONDTABLE.DATE gave me an error :(

Re: [firebird-support] Backup-Restore, without killing existing attachments.

2012-02-20 Thread yanto_asnawi
I do with crontab in linux. I use CentOS 6.1 , firebird classic 2.5.1 64 bit -Original Message- From: "arda" Sender: firebird-support@yahoogroups.com Date: Mon, 20 Feb 2012 12:06:51 To: Reply-To: firebird-support@yahoogroups.com Subject: [firebird-support] Backup-Restore, without killin

[firebird-support] Backup-Restore, without killing existing attachments.

2012-02-20 Thread arda
Hi, I have a question on backup/restore. Think of a firebird classic on a linux box. -Do a backup with existing attachments -After backup, Rename the old gdb file to something else -Restore the backup file with the original gdb name. Don't reboot the server or kill the existing processes(attac

[firebird-support] Re: how to optimize this query ?

2012-02-20 Thread nathanelrick
thanks svein, UNION work like a charm here ! --- In firebird-support@yahoogroups.com, Svein Erling Tysvær wrote: > > >Hello, > > > >this is my query : > > > >Select > > MAINTABLE.ID > >from > > MAINTABLE > >Join SECONDTABLE on SECONDTABLE.ID_obj=MAINTABLE.ID_obj > >Join THIRDTABLE on THIR

RE: [firebird-support] how to optimize this query ?

2012-02-20 Thread Svein Erling Tysvær
>Hello, > >this is my query : > >Select > MAINTABLE.ID >from > MAINTABLE >Join SECONDTABLE on SECONDTABLE.ID_obj=MAINTABLE.ID_obj >Join THIRDTABLE on THIRDTABLE.ID_obj=MAINTABLE.ID_obj >where > (MAINTABLE.name = 'jean' or > SECONDTABLE.name = 'jean' or > THIRDTABLE.name = 'jean')

Re: [firebird-support] Is NOT IN or SMALLINT = 1 efficient?

2012-02-20 Thread Mark Rotteveel
On Mon, 20 Feb 2012 09:51:19 -, "venussoftop" wrote: > Hi all > > I have tables that can allow me to filter data like this: > SELECT a.* >FROM tablea a >WHERE a.iTableBLinkID NOT IN (SELECT b.iPKID FROM tableb b) > ... > these tables will grow over the years with more and more records

[firebird-support] Re: lock the table "partially"

2012-02-20 Thread Svein Erling Tysvær
> >Hello, > > > >i m in multi user database. > > > >I want to clean a table of all entries from one user (rec with field > >id_user=xxx) > >and insert new entries, BUT i must be sure that noone is not actually doing > >any > >insert on this table for this user. i can not lock the table because

[firebird-support] how to optimize this query ?

2012-02-20 Thread nathanelrick
Hello, this is my query : Select MAINTABLE.ID from MAINTABLE Join SECONDTABLE on SECONDTABLE.ID_obj=MAINTABLE.ID_obj Join THIRDTABLE on THIRDTABLE.ID_obj=MAINTABLE.ID_obj where (MAINTABLE.name = 'jean' or SECONDTABLE.name = 'jean' or THIRDTABLE.name = 'jean') I have an ind

[firebird-support] Re: lock the table "partially"

2012-02-20 Thread nathanelrick
Hello, it's when i want to reset aggregated data. I have a temp table where i add a row with +1 and -1 as Item_count_Delta everytime someone add a new item in the product table. at the end of the days i calculate the item count of all products by aggregating all rows from the temp table Now t

[firebird-support] Re: Is NOT IN or SMALLINT = 0 efficient?

2012-02-20 Thread venussoftop
Sorry I messed up the first query, here is the corrected version SELECT a.* FROM tablea a WHERE a.iPKID NOT IN (SELECT b.iTableALinkID FROM tableb b) ... --- In firebird-support@yahoogroups.com, "venussoftop" wrote: > > Hi all > > I have tables that can allow me to filter data like this:

[firebird-support] Is NOT IN or SMALLINT = 1 efficient?

2012-02-20 Thread venussoftop
Hi all I have tables that can allow me to filter data like this: SELECT a.* FROM tablea a WHERE a.iTableBLinkID NOT IN (SELECT b.iPKID FROM tableb b) ... these tables will grow over the years with more and more records cancelling each other out, so there really will be only few tens of reco

RE: [firebird-support] lock the table "partially"

2012-02-20 Thread Svein Erling Tysvær
>Hello, > >i m in multi user database. > >I want to clean a table of all entries from one user (rec with field >id_user=xxx) >and insert new entries, BUT i must be sure that noone is not actually doing >any >insert on this table for this user. i can not lock the table because this will >affect