I have database with follow structure:
CREATE TABLE "article" (
"id" character varying(15) NOT NULL,
"obj_kod" character varying(15),
"popis" character varying(80),
"group1" character varying(40) DEFAULT 'ine',
"group2" character varying(40),
"pic1" character varying(10) DEFAULT 'noname.jpg',
"pic2" character varying(10) DEFAULT 'noname.jpg',
"alt1" character varying(15),
"alt2" character varying(15),
CREATE UNIQUE INDEX "article_pkey" on "article" using btree ( "id"
and with 1000000 rows. Postgres deamon run on 2xPentiumII 330Mhz with
SCSI disk where is
this database store. But I think that select * from article where id
like 'something%' is very slow
(some minutes) and query as: select * from article where id='something'
is very slow too.
I don't know where is a problem a I would like optimalise this, but how
can I do it?
When I use hash except btree, query as: select * from article where
id='something' is fast but
select * from article where id='something%' is very slow.
Can I index some columns externaly? For example: psql index database
Or postgresql make indexes automaticly?
How can I see that postgres use/or no use index on some query? It is
Thank you every reply,
pgsql-sql by date
|Next:||From: Annamalai G||Date: 2000-03-06 05:11:43|
|Subject: dayname() doubt|
|Previous:||From: David Celjuska||Date: 2000-03-05 20:11:02|
|Subject: database with 1000000 rows is very slow|