RE: [firebird-support] union and order by

2012-07-16 Thread Svein Erling Tysvær
Firebird 1.5 classic on Windows. Is it possible to have a SQL with union all and an order by that includes a field that is not in the selects? I'd be very surprised if this was possible, logically you sort a result set and the result set that does not contain your field. If it wasn't for the

[firebird-support] isc_dpb, isc_tpb, isc_spb Constants

2012-07-16 Thread dve83
Hello, I am busy with code for generating the Parameter Buffer for the Service Manager and Im trying to find the mapping (correct values) for actions like isc_svc_display_users. Could you perhaps direct me to any official documentation for such constant - value mapping. I am unable to find it

Re: [firebird-support] isc_dpb, isc_tpb, isc_spb Constants

2012-07-16 Thread Thomas Steinmaurer
Hi, I am busy with code for generating the Parameter Buffer for the Service Manager and Im trying to find the mapping (correct values) for actions like isc_svc_display_users. Could you perhaps direct me to any official documentation for such constant - value mapping. I am unable to find it

Re: [firebird-support] isc_dpb, isc_tpb, isc_spb Constants

2012-07-16 Thread Danie Van Eeden
Many Thanks! Will go check. On Mon, Jul 16, 2012 at 9:02 AM, Thomas Steinmaurer t...@iblogmanager.comwrote: ** Hi, I am busy with code for generating the Parameter Buffer for the Service Manager and Im trying to find the mapping (correct values) for actions like isc_svc_display_users.

Re: [firebird-support] union and order by

2012-07-16 Thread Thomas Steinmaurer
select fieldA, fieldB from table1 where (fieldA starting with 'bd' or fieldA starting with 'bi') and fieldA between 'bd' and 'bj') order by fieldA asc, fieldC asc Thanks, will try that out and report back. I started to use the union instead of the OR when we were still on

Re: [firebird-support] union and order by

2012-07-16 Thread Thomas Steinmaurer
select fieldA, fieldB from table1 where (fieldA starting with 'bd' or fieldA starting with 'bi') and fieldA between 'bd' and 'bj') order by fieldA asc, fieldC asc Thanks, will try that out and report back. I started to use the union instead of the OR when we were

Re: [firebird-support] union and order by

2012-07-16 Thread Bart Smissaert
Have tested and the difference is still enormous, some factor 10. As predicted the added between is slightly quicker than the union construction and thanks for that tip. This is in fact quite useful for me as currently I have to convert a OR SQL in code (VB) to the UNION and as you can imagine

RE: [firebird-support] union and order by

2012-07-16 Thread Svein Erling Tysvær
Have tested and the difference is still enormous, some factor 10. As predicted the added between is slightly quicker than the union construction and thanks for that tip. This is in fact quite useful for me as currently I have to convert a OR SQL in code (VB) to the UNION and as you can imagine

[firebird-support] Firebird's default settings

2012-07-16 Thread Josef Kokeš
Hi! I have never tried to change Firebird's default settings, because the server has always been good enough and if it isn't broken, don't fix it. But I can't help but wonder about some of the settings, because I don't understand their default values. Specifically, assuming Firebird 2.5 in

Re: [firebird-support] union and order by

2012-07-16 Thread Bart Smissaert
Well, it is simple, with the union and with the added between it will use the index on that field, but with the simple or construction it won't. Looks like an omission in the planning code. RBS On 7/16/12, Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no wrote: Have tested and the

Re: [firebird-support] union and order by

2012-07-16 Thread Bart Smissaert
It looks simply replacing the like 'bd%' with starting with 'bd' will make it use the index as well. Will be simpler to do that in code than adding the between. RBS On 7/16/12, Bart Smissaert bart.smissa...@gmail.com wrote: Well, it is simple, with the union and with the added between it will

RE: [firebird-support] union and order by

2012-07-16 Thread Svein Erling Tysvær
It looks simply replacing the like 'bd%' with starting with 'bd' will make it use the index as well. Will be simpler to do that in code than adding the between. Does your statement actually use 'bd%' or a parameter? LIKE :MyParameter can never use an index since it doesn't know if the

Re: [firebird-support] union and order by

2012-07-16 Thread Bart Smissaert
Does your statement actually use 'bd%' or a parameter? It uses 'bd%', so no parameters. Using the starting with will make it all simple as I can do that at source, so no need to programmatically alter a SQL. RBS On Mon, Jul 16, 2012 at 11:17 AM, Svein Erling Tysvær

[firebird-support] limit to number of OR conditions in a where clause

2012-07-16 Thread Bart Smissaert
Firebird 1.5 classic on Windows. Is there a limit to the number of OR conditions you can put in a where clause? It looks there is as I get unexpected end of command when there are some 2000 ors, but maybe that is due limitations of the control holding the SQL. I found some 150 ors is still fine.

Re: [firebird-support] limit to number of OR conditions in a where clause

2012-07-16 Thread Thomas Steinmaurer
Firebird 1.5 classic on Windows. Is there a limit to the number of OR conditions you can put in a where clause? It looks there is as I get unexpected end of command when there are some 2000 ors, but maybe that is due limitations of the control holding the SQL. I found some 150 ors is still

Re: [firebird-support] limit to number of OR conditions in a where clause

2012-07-16 Thread Bart Smissaert
Ah, yes, didn't think of that. Any idea roughly how many characters that will be? RBS On Mon, Jul 16, 2012 at 2:37 PM, Thomas Steinmaurer t...@iblogmanager.comwrote: ** Firebird 1.5 classic on Windows. Is there a limit to the number of OR conditions you can put in a where clause? It

[firebird-support] Re: SELECT statement runs at different speeds

2012-07-16 Thread red_october2009
Hi Philip, Putting some of the smarts into a COMPUTED BY field was a good idea. What I didn't tell you in the original posting was that I actually had two tables with a very similar structure, with the same speed problem. The first one, without any BLOB fields ran much faster using the

Re: [firebird-support] limit to number of OR conditions in a where clause

2012-07-16 Thread Thomas Steinmaurer
Ah, yes, didn't think of that. Any idea roughly how many characters that will be? ~ 64K characters, if your SQL text is using a 1 byte per character encoding, and possibly less for a multi-byte enconding, although I'm not entirely sure if this applies in that area. -- With regards, Thomas

Re: [firebird-support] limit to number of OR conditions in a where clause

2012-07-16 Thread Alan J Davies
I think you want to change the way you look at this - how do you manage to control/check it? I can only imagine its a stored procedure. In which case (no pun intended) you should be able to pass a variable and take action accordingly. I can't remember if the execute statement ability was in

RE: [firebird-support] limit to number of OR conditions in a where clause

2012-07-16 Thread Svein Erling Tysvær
Firebird 1.5 classic on Windows. Is there a limit to the number of OR conditions you can put in a where clause? It looks there is as I get unexpected end of command when there are some 2000 ors, but maybe that is due limitations of the control holding the SQL. I found some 150 ors is still fine.

Re: [firebird-support] limit to number of OR conditions in a where clause

2012-07-16 Thread Bart Smissaert
OK, thanks, I can look out for that and take appropriate action. RBS On 7/16/12, Thomas Steinmaurer t...@iblogmanager.com wrote: Ah, yes, didn't think of that. Any idea roughly how many characters that will be? ~ 64K characters, if your SQL text is using a 1 byte per character encoding,

Re: [firebird-support] limit to number of OR conditions in a where clause

2012-07-16 Thread Bart Smissaert
Interesting idea that, but I don't think I need it. Actually we are not allowed to write to the database only read. RBS On 7/16/12, Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no wrote: Firebird 1.5 classic on Windows. Is there a limit to the number of OR conditions you can put in

Re: [firebird-support] Modified procedure works like before

2012-07-16 Thread Ann Harrison
On Sun, Jul 15, 2012 at 6:35 PM, mariuszstefaniak mariuszstefan...@yahoo.com wrote: I've strange problem. Sometimes (sometimes, because problem is quite irregular), after I altered procedure, firebird still runs unchanged (previous) version of my procedure. Procedure fired directly (by

Re: [firebird-support] Firebird's default settings

2012-07-16 Thread Ann Harrison
On Mon, Jul 16, 2012 at 4:46 AM, Josef Kokeš j.ko...@apatykaservis.czwrote: Hi! Specifically, assuming Firebird 2.5 in the default install (which, I believe, is using SuperServer): - CpuAffinityMask - I can see why the value 1 would be a safe lower bound, but why doesn't the server

Re: [firebird-support] Firebird's default settings

2012-07-16 Thread Josef Kokeš
The problem is that SuperServer is multi-threaded but not interlocked, so only one thread runs at a time so it cannot take advantage of multiple cores. Some operating systems move the process from one core to another in an attempt to balance load. That degrades performance, but can be

[firebird-support] Firebird Linux Slow Down Issues

2012-07-16 Thread firetrackers
After experiencing significant slowdowns on clients upgrading to Windows Server 2008, we have decided to work on configuring a Linux server to host our Firebird databases. The problem we are having is that our benchmarking is showing that Window 7 is outperfoming Linux (CentOS). The same