From: Tomasz Myrta <jasiek@klaster.net>
To: Alexander Priem <ap@cict.nl>
Cc: pgsql-performance@postgresql.org
Subject: Re: Indexing question
Date: Fri, 29 Aug 2003 10:57:25 +0200
Message-ID: <3F4F1575.8090600@klaster.net> (raw)
In-Reply-To: <018c01c36e09$4893e980$b696a8c0@APR>
References: <012f01c36dfa$0f4a8760$b696a8c0@APR>
<3F4EFAB6.7030104@klaster.net>
<015f01c36e02$134fe960$b696a8c0@APR>
<3F4F07CE.6090803@klaster.net>
<018c01c36e09$4893e980$b696a8c0@APR>
> create index orad_id_index on orderadvice (orad_id) where orad_deleteddate
> is null;
> create index orad_name_index on orderadvice (orad_name) where
> orad_deleteddate is null;
>
> create view orderadvice_edit as select
> orad_id,orad_name,orad_description,orad_value,orad_value_quan from
> orderadvice where orad_deleteddate is null;
>
> Would queries like 'select * from orderadvice_edit where orad_id=100' or
> 'select * from orderadvice_edit order by orad_name' both use one of these
> two partial indexes, given enough records are present in the table?
>
> There would be a double index on the primary key this way, right?
It looks much better now. I'm not sure about the second index. Probably
it will be useless, because you sort ALL records with deleteddtata is
null. Maybe the first index will be enough.
I'm not sure what to do with doubled index on a primary key field.
Regards,
Tomasz Myrta
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: jasiek@klaster.net, ap@cict.nl
Subject: Re: Indexing question
In-Reply-To: <3F4F1575.8090600@klaster.net>
* 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