Subject Re: hung on isc_commit_retaining
Author maverickthunder
Hi Dimitry,

Too see an example at home (using xp, I have a subset of the whole DB with 65,000,000 rows and db size of 5 gb) and doing a query with SQL Maestro for firebird:

CREATE TABLE "Historic" (
"Symbol_ID" CHAR(5) NOT NULL,
"Exchange_ID" CHAR(4) NOT NULL,
"Date" TIMESTAMP NOT NULL,
"Open" DOUBLE PRECISION NOT NULL,
"Close" DOUBLE PRECISION NOT NULL,
"Low" DOUBLE PRECISION NOT NULL,
"High" DOUBLE PRECISION NOT NULL,
"Volume" DOUBLE PRECISION NOT NULL,
/* Keys */
CONSTRAINT "PK_Historic"
PRIMARY KEY ("Symbol_ID", "Exchange_ID", "Date"),
/* Foreign keys */
CONSTRAINT "Fgn_Company_Hist"
FOREIGN KEY ("Symbol_ID", "Exchange_ID")
REFERENCES "Companies"("Symbol", "Exchange")
ON DELETE CASCADE
ON UPDATE CASCADE
);

Now I execute: SELECT COUNT(*) FROM "Historico";

Most of the time fbserver.exe was consuming about 20% cpu time (no other process except taskmgr consuming about 2%)

Result: After 5 minutes I dedided to cancel the query.

I don't know how to execute a PLAN query, but a single COUNT(*) takes too much time.

Regards,
Mauro.

--- In firebird-support@yahoogroups.com, Dimitry Sibiryakov <sd@...> wrote:
>
> > When I run "SELECT * FROM table1", in my machine (XP) it tooks about 2 minutes to execute
> > the query before i can make the first fetch, but in Win Vista, app gets hung and also
> > Vista begin to function slowly until I terminate the process.
>
> You must do something really wrong to cause this query to run 2
> minutes. Show us connection string and the query's plan.
>
> > What should I do? Do fetches and call isc_rollback_retaining? Is always needed to start a
> > transaction?
>
> Do "hard commit". Yes, transactions is always needed.
>
> SY, SD.
>