Subject | Re: Slow query in Firebird/Interbase |
---|---|
Author | bortoswatkins |
Post date | 2004-01-23T08:55:39Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
Firebird 1.03, fb 1.5, and interbase 7.1. with same results. the
listing you saw was from my last attempt with interbase 7.1.
Here is the DDL from the FB 1.03.
CREATE TABLE LEDGER (
ID DOUBLE PRECISION NOT NULL,
ENTERED_DATE TIMESTAMP,
EFFECTIVE_DATE TIMESTAMP,
CATEGORY_ID DOUBLE PRECISION,
DESCRIPTION VARCHAR(50),
COMPANY_ID DOUBLE PRECISION,
LEDGER_TYPE DOUBLE PRECISION,
CLEARED CHAR(1),
MEMO VARCHAR(1000),
CHK_AMT NUMERIC(9,2),
DEPOSIT_AMT NUMERIC(9,2),
USERID SMALLINT);
ALTER TABLE LEDGER ADD CONSTRAINT ILEDGER_ID PRIMARY KEY (ID);
CREATE INDEX ILEDGER_CATEGORY_ID ON LEDGER (CATEGORY_ID);
The query takes rows and creates a running balance for every row.
ie..
row 1 1 5.00 1/1/2003
row 2 2 6.25 1/2/2003
row 3 3 5.00 1/3/2003
this source data would return:
row 1 1 5.00 1/1/2003 5.00
row 2 2 6.25 1/2/2003 11.25
row 3 3 5.00 1/3/2003 16.25
Let me know if this clears it up.
I can post source data somewhere if you would like??
wrote:
> At 03:43 AM 23/01/2004 +0000, you wrote:going to
>
> >Database header page information:
> > Flags 0
> > Checksum 12345
> > Generation 105
> > Page size 4096
> > ODS version 11.1
>
> This is not a Firebird database. I think, like it or not, you are
> have to get back to Square One, create a database by conventionalmeans, on
> the server on which you plan to test it.Like I stated in the original post. I have created this gdb in
>
> /hb
Firebird 1.03, fb 1.5, and interbase 7.1. with same results. the
listing you saw was from my last attempt with interbase 7.1.
Here is the DDL from the FB 1.03.
CREATE TABLE LEDGER (
ID DOUBLE PRECISION NOT NULL,
ENTERED_DATE TIMESTAMP,
EFFECTIVE_DATE TIMESTAMP,
CATEGORY_ID DOUBLE PRECISION,
DESCRIPTION VARCHAR(50),
COMPANY_ID DOUBLE PRECISION,
LEDGER_TYPE DOUBLE PRECISION,
CLEARED CHAR(1),
MEMO VARCHAR(1000),
CHK_AMT NUMERIC(9,2),
DEPOSIT_AMT NUMERIC(9,2),
USERID SMALLINT);
ALTER TABLE LEDGER ADD CONSTRAINT ILEDGER_ID PRIMARY KEY (ID);
CREATE INDEX ILEDGER_CATEGORY_ID ON LEDGER (CATEGORY_ID);
The query takes rows and creates a running balance for every row.
ie..
row 1 1 5.00 1/1/2003
row 2 2 6.25 1/2/2003
row 3 3 5.00 1/3/2003
this source data would return:
row 1 1 5.00 1/1/2003 5.00
row 2 2 6.25 1/2/2003 11.25
row 3 3 5.00 1/3/2003 16.25
Let me know if this clears it up.
I can post source data somewhere if you would like??