pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Celjuska <dcsoft@dcsoft.sk>
To: pgsql-sql@postgresql.org
Subject: database with 1000000 rows is very slow
Date: Sun, 05 Mar 2000 21:21:53 +0100
Message-ID: <38C2C1E1.A41501BD@dcsoft.sk> (raw)

Hallo All!

I have database with follow structure:

CREATE TABLE "article" (
        "id" character varying(15) NOT NULL,
        "obj_kod" character varying(15),
        "popis" character varying(80),
        "net_price" float4,
        "our_price" float4,
        "quantity" int2,
        "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),
        "zisk" int2);

CREATE UNIQUE INDEX "article_pkey" on "article" using btree ( "id"
"varchar_ops" );

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
table col.
Or postgresql make indexes automaticly?

How can I see that postgres use/or no use index on some query? It is
possible?

Thank you every reply,
    Davy!



view thread (6+ messages)  latest in thread

Message-ID: <38C2C1E1.A41501BD@dcsoft.sk>
Permalink:  ../38C2C1E1.A41501BD@dcsoft.sk/
Also on:    postgresql.org/message-id/38C2C1E1.A41501BD@dcsoft.sk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: dcsoft@dcsoft.sk
  Subject: Re: database with 1000000 rows is very slow
  In-Reply-To: <38C2C1E1.A41501BD@dcsoft.sk>
  References: <38C2C1E1.A41501BD@dcsoft.sk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox