descending index

Lists: pgsql-general
From: "Pirtea Calin" <pcalin(at)rdsor(dot)ro>
To: pgsql-general(at)postgresql(dot)org
Subject: descending index
Date: 2002-02-27 14:14:48
Message-ID: a5ipkk$2j7d$1@jupiter.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

I'm creating a small database, for test puproses, in PostgreSQL
and after some unsuccesfull attempts to find the answer in the
pdf documentation i've turn to this newsgroup for help.

I have read (partialy) the reference guide from the official site
and stoped at topic create index. I can't find no mention about
creating descending indexes. Is there such a thing as descending
index in PostgreSQL or is it not needed?
If yes where can i find the propper documentation on how to create one?

I spent the last days rewriting some scripts that i used to create
a database in Firebird in order to be able to use them in PostgreSQL.
My final purpose is to write a small test application that can compare
results between Firebird and PostgreSQL.

Since Firebird and PostgreSQL are quite diferent in too many ways
i won't do some complicated database design and i try to use features
that are similar in both RDBMS. I know a lot of users are interested
in a comparison between these 2 database servers since they are both
Open Source and cost free so i decided to make this test application.
I would also appreciate some hints into creating a test sample in such
manner that it would be usefull for many users as a comparison for
speed, number of features, and so on ...

TIA.

--
Best regards,
Aplication Developer
Pirtea Calin Iancu
S.C. SoftScape S.R.L.
pcalin(at)rdsor(dot)ro


From: Bjrn Lundin <bjorn(dot)lundin(at)swipnet(dot)se>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: descending index
Date: 2002-02-27 16:15:41
Message-ID: 20020227171541.7bf5efd3.bjorn.lundin@swipnet.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Wed, 27 Feb 2002 16:14:48 +0200
"Pirtea Calin" <pcalin(at)rdsor(dot)ro> wrote:

> I'm creating a small database, for test puproses, in PostgreSQL
> and after some unsuccesfull attempts to find the answer in the
> pdf documentation i've turn to this newsgroup for help.
>
> I have read (partialy) the reference guide from the official site
> and stoped at topic create index. I can't find no mention about
> creating descending indexes. Is there such a thing as descending
> index in PostgreSQL or is it not needed?
> If yes where can i find the propper documentation on how to create one?

Can't you use 'order by' with 'asc or desc' ?
/Björn


From: "Pirtea Calin" <pcalin(at)rdsor(dot)ro>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: descending index
Date: 2002-02-27 18:23:31
Message-ID: a5j8g3$1jhs$1@jupiter.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

"Björn Lundin" wrote:
> Can't you use 'order by' with 'asc or desc' ?
> /Björn

Of course. I just wanted to know if there is a diference between using
order by field asc/desc regarding the way indexes are used in plans
when you execute a query. In Firebird when using order by desc it uses
the descending index if available if not then it uses natural scan with
sort descending. Does PostgreSQL use the ascending index both for
asc and desc order by?

Thanks in advance.

--
Best regards,
Aplication Developer
Pirtea Calin Iancu
S.C. SoftScape S.R.L.
pcalin(at)rdsor(dot)ro


From: CoL <col(at)mportal(dot)hu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: descending index
Date: 2002-02-28 01:13:22
Message-ID: 3C7D8432.7060606@mportal.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Pirtea Calin wrote:
> "Björn Lundin" wrote:
>
>>Can't you use 'order by' with 'asc or desc' ?
>>/Björn
>>
>
> Of course. I just wanted to know if there is a diference between using
> order by field asc/desc regarding the way indexes are used in plans
> when you execute a query. In Firebird when using order by desc it uses
> the descending index if available if not then it uses natural scan with
> sort descending. Does PostgreSQL use the ascending index both for
> asc and desc order by?
>
> Thanks in advance.
>
Both.

C.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pirtea Calin" <pcalin(at)rdsor(dot)ro>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: descending index
Date: 2002-03-04 15:28:06
Message-ID: 4035.1015255686@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

"Pirtea Calin" <pcalin(at)rdsor(dot)ro> writes:
> Is there such a thing as descending
> index in PostgreSQL or is it not needed?

It's not needed.

regards, tom lane


From: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>
To: "Pirtea Calin" <pcalin(at)rdsor(dot)ro>, pgsql-general(at)postgresql(dot)org
Subject: Re: descending index
Date: 2002-03-04 16:59:24
Message-ID: 200203041659.g24GxOLx027245@www1.translationforge
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Le Mercredi 27 Février 2002 15:14, Pirtea Calin a écrit :
> I spent the last days rewriting some scripts that i used to create
> a database in Firebird in order to be able to use them in PostgreSQL.
> My final purpose is to write a small test application that can compare
> results between Firebird and PostgreSQL.

PostgreSQL does not offer ascending/decending indexes, probably because they
are not really needed. Why do you need them? Maybe we can set up a more
powerfull solution based on triggers, views, PLpgSQL, etc...

Maybe you should try pgAdmin2, Windows PostgreSQL GUI
(http://pgadmin.postgresql.org). It has an online PostgreSQL 7.2 guide in
user help. You may import your existing Firebuid application and rewrite it.

Feel free to send us more information about your test DB.
Cheers, Jean-MIchel POURE


From: "Pirtea Calin" <pcalin(at)rdsor(dot)ro>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: descending index
Date: 2002-03-05 18:11:53
Message-ID: 013f01c1c471$4b5b2ea0$0100a8c0@dizzy
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

>From: "Jean-Michel POURE"
>Maybe you should try pgAdmin2, Windows PostgreSQL GUI
>(http://pgadmin.postgresql.org). It has an online PostgreSQL 7.2 guide in
>user help. You may import your existing Firebuid application and rewrite
it.

:) Thanks. That's what i use to inspect the database. But i access it from
Delphi. I find it a very nice tool though. For Delphi i use Zeos Access
components because they allow me to connect both to Firebird and PostgreSQL.

>Feel free to send us more information about your test DB.
>Cheers, Jean-MIchel POURE

Count on that. For the moment i'm in the faze of inserting (pumping) data to
the
server (SUSE 7.3; Last versions from PostgreSQL and Firebird at the end of
last
year) while i'm reading the documentation from PostgreSQL site. After that
i'll start
making tests. I'm more interested in features compare because i expect
similar results
(very similar) in speed, so is more a question of when is one recomended and
when
is the other.

I already have a question but i'll post it in a new mail.

Thank you very much for the answer.

Best regards,
Aplication Developer
Pirtea Calin Iancu
S.C. SoftScape S.R.L.
pcalin(at)rdsor(dot)ro