Is it possible to have a SELECT which says me if the current transaction ...
- Is READ COMMITED or SNAPSHOT
- Is READ ONLY or READ WRITE
- Is WAIT or NO WAIT
?
SELECT
*
FROM
MON$TRANSACTIONS
WHERE
MON$TRANSACTION_ID = CURRENT_TRANSACTION
Regards,
Thomas
Hi,
This is really weird.
I cannot see why a NATURAL plan is being used instead of my index, I am not
doing anything fancy.
Using: FB2.5.1 32 bit classic server
Query:
select t.SalesOrderNo from stk_stocktransaction t
where (t.SourceType = 34)
and (t.TransactionType = 'EXTCST')
and
Hi,
This is really weird.
I cannot see why a NATURAL plan is being used instead of my index, I am not
doing anything fancy.
Using: FB2.5.1 32 bit classic server
Query:
select t.SalesOrderNo from stk_stocktransaction t
where (t.SourceType = 34)
and (t.TransactionType = 'EXTCST')
Hi,
This is really weird.
I cannot see why a NATURAL plan is being used instead of my index, I am not
doing anything fancy.
Using: FB2.5.1 32 bit classic server
Query:
select t.SalesOrderNo from stk_stocktransaction t where (t.SourceType
= 34)
and (t.TransactionType = 'EXTCST')
This is really weird.
I cannot see why a NATURAL plan is being used instead of my index, I am not
doing anything fancy.
Using: FB2.5.1 32 bit classic server
Query:
select t.SalesOrderNo from stk_stocktransaction t where (t.SourceType
= 34)
and (t.TransactionType = 'EXTCST')
select t.SalesOrderNo from stk_stocktransaction t where (t.SourceType
= 34) and (t.TransactionType = 'EXTCST') and (t.RefNo = 'I1')
Plan is:
PLAN (T NATURAL)
Yet I have the following index: SourceType, TransactionType, RefNo asc
With selectivity: 0.049
There are only two
Running SET STATISTICS on this particular index
Query RDB$INDICES.RDB$STATISTICS for this index
No Change: 0.049277592
Also you can generate a histogram of the used values/permutation with:
select
sourcetype
, transactiontype
, refno
, count(*)
from
stk_stocktransaction
Now, I wonder if something similar could actually be done internally by
Firebird for the general like case?
It could some nifty query logic like the above internally, could it not? If
like xxx always generated
internally a query logic like this:
where myfield starting with prefixof :param up
Den 2012-10-31 10:45 skrev Svein Erling Tysvær såhär:
I tried manually LIKE with and without the addition of STARTING WITH
and tried what I thought was likely to have worse performance with
STARTING WITH - when the parameter starts with a wildcard. With
STARTING WITH, my query executed in
Maya,
Can you extract the table's full DDL and post here?
Kjell
--
--
Kjell Rilbe
DataDIA AB
E-post: kj...@datadia.se
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
I tried manually LIKE with and without the addition of STARTING WITH
and tried what I thought was likely to have worse performance with
STARTING WITH - when the parameter starts with a wildcard. With
STARTING WITH, my query executed in 5.4 seconds, without it 4.6
seconds. So, in my simple
Running SET STATISTICS on this particular index
Query RDB$INDICES.RDB$STATISTICS for this index
No Change: 0.049277592
Also you can generate a histogram of the used values/permutation with:
select
sourcetype
, transactiontype
, refno
, count(*)
from
Can you extract the table's full DDL and post here?
CREATE TABLE STK_STOCKTRANSACTION (
ID INTEGER DEFAULT 0 NOT NULL,
TRANSACTIONTYPE VARCHAR(6),
STOCKCODEVARCHAR(25),
SALESORDERNO VARCHAR(15),
UOM
CREATE TABLE STK_STOCKTRANSACTION (
ID INTEGER DEFAULT 0 NOT NULL,
TRANSACTIONTYPE VARCHAR(6),
STOCKCODEVARCHAR(25),
SALESORDERNO VARCHAR(15),
UOM VARCHAR(3),
REFNO
Thank you very much Thomas.
Greetings.
Walter.
El 31/10/2012 03:58, Thomas Steinmaurer t...@iblogmanager.com escribió:
**
Is it possible to have a SELECT which says me if the current transaction
...
- Is READ COMMITED or SNAPSHOT
- Is READ ONLY or READ WRITE
- Is WAIT or NO WAIT
?
SOURCEID INTEGER,
SOURCETYPE VARCHAR(15),
You told us, that SOURCETYPE is not a [VAR]CHAR but a numeric type. Ts, ts, ts
...
Ahhh, thank you, thank you, thank you
I must be going cross-eyed and looked at the one above by mistake - reading
Two problems, perhaps related:
Created a database using sql creation script; opened the empty db in FB
connection tab and all was well; Opened and closed my development platform to
confirm it saw the db, and again all was well; reopened db in FB and received
I/O error.Restarted Windows. Again
Is there a way to achieve the logic I'm trying to accomplish with the CASE
statement in the WHERE clause below?
CREATE OR ALTER PROCEDURE GET_DATA (
Input_code char(1) )
RETURNS (
Output_code integer )
as
begin
FOR SELECT T.Output_code
FROM Table T
WHERE
No.
You have some errors in the logic and data types.
You can try this. You will get one record returned for every record in
your table.
CREATE OR ALTER PROCEDURE GET_DATA (
Input_code char(1) )
RETURNS (
Output_code char(1) ) /* you have an integer which will fail */
as
begin
for select
19 matches
Mail list logo