Thread: Indexes generated for primary key are not show by PgAdminIII.

Indexes generated for primary key are not show by PgAdminIII.

From
Constantin Stefanov
Date:
Hello.

I have PgAdmin III 1.0.2 and PostgreSQL 7.4.1.
When I create a table with primary key constraint on it, PostgreSQL
automatically creates an index on that column (or columns), which is
then shown in psql with \di command.
But PgAdmin does not show that index in
...Tables-> <table name> -> Indexes in the left frame.
Sometimes it is useful to see all indexes on the table (for example,
when trying to understand planner decisions), because planner makes use
of those indexes.

So I suggest PgAdmin to show all indexes (user and system-generated) or
to have an option to show them all.

-- 
Constantin Stefanov


Re: Indexes generated for primary key are not show

From
Andreas Pflug
Date:
Constantin Stefanov wrote:

>Hello.
>
>I have PgAdmin III 1.0.2 and PostgreSQL 7.4.1.
>When I create a table with primary key constraint on it, PostgreSQL
>automatically creates an index on that column (or columns), which is
>then shown in psql with \di command.
>But PgAdmin does not show that index in
>...Tables-> <table name> -> Indexes in the left frame.
>Sometimes it is useful to see all indexes on the table (for example,
>when trying to understand planner decisions), because planner makes use
>of those indexes.
>
>So I suggest PgAdmin to show all indexes (user and system-generated) or
>to have an option to show them all.
>  
>

These indexes (primary and unique if defined by constraint) are filtered 
out intentionally, but I see your point about the planner. Making them 
display would be a little more complicated than it seems, because we 
need to avoid having them duplicated in the table's definition pane 
(once as constraint, once as index).

Regards,
Andreas




Re: Indexes generated for primary key are not show

From
Constantin Stefanov
Date:
Andreas Pflug wrote:
>> I have PgAdmin III 1.0.2 and PostgreSQL 7.4.1.
>> When I create a table with primary key constraint on it, PostgreSQL
>> automatically creates an index on that column (or columns), which is
>> then shown in psql with \di command.
>> But PgAdmin does not show that index in
>> ...Tables-> <table name> -> Indexes in the left frame.
>> Sometimes it is useful to see all indexes on the table (for example,
>> when trying to understand planner decisions), because planner makes use
>> of those indexes.
>>
>> So I suggest PgAdmin to show all indexes (user and system-generated) or
>> to have an option to show them all.
>>
> These indexes (primary and unique if defined by constraint) are filtered
> out intentionally, but I see your point about the planner. Making them
> display would be a little more complicated than it seems, because we
> need to avoid having them duplicated in the table's definition pane
> (once as constraint, once as index).
Why should such duplication be avoided? There is both constraint
(primary key) and index. Constraint is something logical, index is a way
to implement it. When I 'connect' a trigger to a table, there is trigger
as a function, and trigger usage for a table. Yes, index is more tightly
connected with its table, but in a case of a constraint it is still an
index but system-generated.
And if it would be an option to show such indexes, such duplication is
not a problem at all - if you turn this option on (it may be off by
default), you know what you are doing and know that some constraints may
be duplicated as indexes.

-- 
Constantin Stefanov