Subject Re: [firebird-support] Re: First word after in alphabetical order
Author Eric SIBERT
> That is the first thing you should check. Get yourself an admin tool
> that graphically shows you the plan of the query. IBPlanalyzer is
> simple enough and free.

IBPlanalyzer website is down right now.

> Is this the exact query you are running or is this a simplified
> representation of your actual query?

It is not the exact query, I changed names. All the details :
- my server is a celeron 333 MHz with 256 MB memory
- it runs under linux with SME server 6.0 (fork of RH7.3, see
http://www.contribs.org).
- I insralled FB using a rpm : FirebirdSS-1.5.2.4731-0.i686.rpm
- I am using IBOConsole with interactive SQL for my test
- my database have a single table (see definition at bottom):
- I filled my table using an external table (source file that I modified
: http://earth-info.nga.mil/gns/html/cntry_files.html). There are
5,000,000 rows. I distroyed indexes before filling it and I recreated
indexes after so they should be clean.
- test query is :
SELECT FIRST 11
ID_WAYPOINT
FROM WAYPOINTS
WHERE WP_NOM>='CHAMBER'
ORDER BY WP_NOM;
=>1mn45s

Eric


PS : table definition

/* Table: WAYPOINTS, Owner: SYSDBA */

CREATE TABLE "WAYPOINTS"
(
"ID_WAYPOINT" INTEGER NOT NULL,
"WP_NOM" CHAR(8) CHARACTER SET ASCII NOT NULL,
"WP_COMMENTAIRE" VARCHAR(20) CHARACTER SET ISO8859_1,
"WP_LATITUDE" DOUBLE PRECISION NOT NULL,
"WP_LONGITUDE" DOUBLE PRECISION NOT NULL,
"WP_ALTITUDE" INTEGER,
CONSTRAINT "PK_WAYPOINTS" PRIMARY KEY ("ID_WAYPOINT")
);

/* Index definitions for WAYPOINTS */

CREATE INDEX "IDX_WP_LAT" ON "WAYPOINTS"("WP_LATITUDE");
CREATE INDEX "IDX_WP_LONG" ON "WAYPOINTS"("WP_LONGITUDE");
CREATE INDEX "IDX_WP_NOM" ON "WAYPOINTS"("WP_NOM");
CREATE DESCENDING INDEX "IDX_WP_NOM_DESC" ON "WAYPOINTS"("WP_NOM");
SET TERM ^ ;


/* Triggers only will work for SQL triggers */

CREATE TRIGGER "TRIG_WAYPOINTS_1" FOR "WAYPOINTS"
ACTIVE BEFORE INSERT POSITION 0
as
/* code here */

begin
if (new.ID_WAYPOINT is NULL) then
new.ID_WAYPOINT = gen_id(NomGenerateur,1);
end
^

COMMIT WORK ^
SET TERM ;^