Обсуждение: wrong indexes sizes on index page

Поиск
Список
Период
Сортировка

wrong indexes sizes on index page

От
Timon
Дата:
see attachment.
Last column on table shows index size, but 227MB - is table size.

postgresql 8.4.4

pgadmin 1.13 last dev build from git

--
All bugs reserved

Вложения

Re: wrong indexes sizes on index page

От
Thom Brown
Дата:
On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
> see attachment.
> Last column on table shows index size, but 227MB - is table size.
>
> postgresql 8.4.4
>
> pgadmin 1.13 last dev build from git
>

I can confirm this using pgAdmin ... weird special version Dave gave
me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

Re: wrong indexes sizes on index page

От
Guillaume Lelarge
Дата:
Le 12/10/2010 11:47, Thom Brown a écrit :
> On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
>> see attachment.
>> Last column on table shows index size, but 227MB - is table size.
>>
>> postgresql 8.4.4
>>
>> pgadmin 1.13 last dev build from git
>>
>
> I can confirm this using pgAdmin ... weird special version Dave gave
> me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.
>

I don't think we changed anything in this area. So you should have the
same issue with 1.12.


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Re: wrong indexes sizes on index page

От
Timon
Дата:
2010/10/12 Guillaume Lelarge <guillaume@lelarge.info>:
> Le 12/10/2010 11:47, Thom Brown a écrit :
>> On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
>>> see attachment.
>>> Last column on table shows index size, but 227MB - is table size.
>>>
>>> postgresql 8.4.4
>>>
>>> pgadmin 1.13 last dev build from git
>>>
>>
>> I can confirm this using pgAdmin ... weird special version Dave gave
>> me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.
>>
>
> I don't think we changed anything in this area. So you should have the
> same issue with 1.12.
yes, I have this issue with 1.12.


--
All bugs reserved

Re: wrong indexes sizes on index page

От
Thom Brown
Дата:
On 12 October 2010 11:01, Timon <timosha@gmail.com> wrote:
> 2010/10/12 Guillaume Lelarge <guillaume@lelarge.info>:
>> Le 12/10/2010 11:47, Thom Brown a écrit :
>>> On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
>>>> see attachment.
>>>> Last column on table shows index size, but 227MB - is table size.
>>>>
>>>> postgresql 8.4.4
>>>>
>>>> pgadmin 1.13 last dev build from git
>>>>
>>>
>>> I can confirm this using pgAdmin ... weird special version Dave gave
>>> me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.
>>>
>>
>> I don't think we changed anything in this area. So you should have the
>> same issue with 1.12.
> yes, I have this issue with 1.12.

Looks like it's getting the OID of the table the index is associated
with rather than just using the indexrelid column from
pg_stat_all_indexes.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

Re: wrong indexes sizes on index page

От
Guillaume Lelarge
Дата:
Le 12/10/2010 14:37, Thom Brown a écrit :
> On 12 October 2010 11:01, Timon <timosha@gmail.com> wrote:
>> 2010/10/12 Guillaume Lelarge <guillaume@lelarge.info>:
>>> Le 12/10/2010 11:47, Thom Brown a écrit :
>>>> On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
>>>>> see attachment.
>>>>> Last column on table shows index size, but 227MB - is table size.
>>>>>
>>>>> postgresql 8.4.4
>>>>>
>>>>> pgadmin 1.13 last dev build from git
>>>>>
>>>>
>>>> I can confirm this using pgAdmin ... weird special version Dave gave
>>>> me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.
>>>>
>>>
>>> I don't think we changed anything in this area. So you should have the
>>> same issue with 1.12.
>> yes, I have this issue with 1.12.
>
> Looks like it's getting the OID of the table the index is associated
> with rather than just using the indexrelid column from
> pg_stat_all_indexes.
>

You're right. Not sure what I was thinking when I applied this on 1.12.
Quick patch (not yet checked):

diff --git a/pgadmin/schema/pgIndex.cpp b/pgadmin/schema/pgIndex.cpp
index e55daf3..4c2fa23 100644
--- a/pgadmin/schema/pgIndex.cpp
+++ b/pgadmin/schema/pgIndex.cpp
@@ -374,7 +374,7 @@ void pgIndexBase::ShowStatistics(frmMain *form,
ctlListView
              wxT(", idx_blks_hit AS ") + qtIdent(_("Index Blocks Hit"));

     if (GetConnection()->HasFeature(FEATURE_SIZE))
-        sql += wxT(", pg_size_pretty(pg_relation_size(") + GetOidStr()
+ wxT(")
+        sql += wxT(", pg_size_pretty(pg_relation_size(indexrelid)) AS
") + qtId

     if (showExtendedStatistics)
     {

If you want to test, it's all yours. Will check tonight and apply if
good enough.


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Re: wrong indexes sizes on index page

От
Thom Brown
Дата:
On 12 October 2010 16:19, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> Le 12/10/2010 14:37, Thom Brown a écrit :
>> On 12 October 2010 11:01, Timon <timosha@gmail.com> wrote:
>>> 2010/10/12 Guillaume Lelarge <guillaume@lelarge.info>:
>>>> Le 12/10/2010 11:47, Thom Brown a écrit :
>>>>> On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
>>>>>> see attachment.
>>>>>> Last column on table shows index size, but 227MB - is table size.
>>>>>>
>>>>>> postgresql 8.4.4
>>>>>>
>>>>>> pgadmin 1.13 last dev build from git
>>>>>>
>>>>>
>>>>> I can confirm this using pgAdmin ... weird special version Dave gave
>>>>> me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.
>>>>>
>>>>
>>>> I don't think we changed anything in this area. So you should have the
>>>> same issue with 1.12.
>>> yes, I have this issue with 1.12.
>>
>> Looks like it's getting the OID of the table the index is associated
>> with rather than just using the indexrelid column from
>> pg_stat_all_indexes.
>>
>
> You're right. Not sure what I was thinking when I applied this on 1.12.
> Quick patch (not yet checked):
>
> diff --git a/pgadmin/schema/pgIndex.cpp b/pgadmin/schema/pgIndex.cpp
> index e55daf3..4c2fa23 100644
> --- a/pgadmin/schema/pgIndex.cpp
> +++ b/pgadmin/schema/pgIndex.cpp
> @@ -374,7 +374,7 @@ void pgIndexBase::ShowStatistics(frmMain *form,
> ctlListView
>              wxT(", idx_blks_hit AS ") + qtIdent(_("Index Blocks Hit"));
>
>     if (GetConnection()->HasFeature(FEATURE_SIZE))
> -        sql += wxT(", pg_size_pretty(pg_relation_size(") + GetOidStr()
> + wxT(")
> +        sql += wxT(", pg_size_pretty(pg_relation_size(indexrelid)) AS
> ") + qtId
>
>     if (showExtendedStatistics)
>     {
>
> If you want to test, it's all yours. Will check tonight and apply if
> good enough.

I made the exact same change to my copy :)  ..but I can't build it at
work since I've only got Windows here. :/

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

Re: wrong indexes sizes on index page

От
Thom Brown
Дата:
On 12 October 2010 16:19, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> Le 12/10/2010 14:37, Thom Brown a écrit :
>> On 12 October 2010 11:01, Timon <timosha@gmail.com> wrote:
>>> 2010/10/12 Guillaume Lelarge <guillaume@lelarge.info>:
>>>> Le 12/10/2010 11:47, Thom Brown a écrit :
>>>>> On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
>>>>>> see attachment.
>>>>>> Last column on table shows index size, but 227MB - is table size.
>>>>>>
>>>>>> postgresql 8.4.4
>>>>>>
>>>>>> pgadmin 1.13 last dev build from git
>>>>>>
>>>>>
>>>>> I can confirm this using pgAdmin ... weird special version Dave gave
>>>>> me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.
>>>>>
>>>>
>>>> I don't think we changed anything in this area. So you should have the
>>>> same issue with 1.12.
>>> yes, I have this issue with 1.12.
>>
>> Looks like it's getting the OID of the table the index is associated
>> with rather than just using the indexrelid column from
>> pg_stat_all_indexes.
>>
>
> You're right. Not sure what I was thinking when I applied this on 1.12.
> Quick patch (not yet checked):
>
> diff --git a/pgadmin/schema/pgIndex.cpp b/pgadmin/schema/pgIndex.cpp
> index e55daf3..4c2fa23 100644
> --- a/pgadmin/schema/pgIndex.cpp
> +++ b/pgadmin/schema/pgIndex.cpp
> @@ -374,7 +374,7 @@ void pgIndexBase::ShowStatistics(frmMain *form,
> ctlListView
>              wxT(", idx_blks_hit AS ") + qtIdent(_("Index Blocks Hit"));
>
>     if (GetConnection()->HasFeature(FEATURE_SIZE))
> -        sql += wxT(", pg_size_pretty(pg_relation_size(") + GetOidStr()
> + wxT(")
> +        sql += wxT(", pg_size_pretty(pg_relation_size(indexrelid)) AS
> ") + qtId
>
>     if (showExtendedStatistics)
>     {
>
> If you want to test, it's all yours. Will check tonight and apply if
> good enough.

Okay, built with change and works fine :)

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

Re: wrong indexes sizes on index page

От
Guillaume Lelarge
Дата:
Le 13/10/2010 00:35, Thom Brown a écrit :
> On 12 October 2010 16:19, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>> Le 12/10/2010 14:37, Thom Brown a écrit :
>>> On 12 October 2010 11:01, Timon <timosha@gmail.com> wrote:
>>>> 2010/10/12 Guillaume Lelarge <guillaume@lelarge.info>:
>>>>> Le 12/10/2010 11:47, Thom Brown a écrit :
>>>>>> On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
>>>>>>> see attachment.
>>>>>>> Last column on table shows index size, but 227MB - is table size.
>>>>>>>
>>>>>>> postgresql 8.4.4
>>>>>>>
>>>>>>> pgadmin 1.13 last dev build from git
>>>>>>>
>>>>>>
>>>>>> I can confirm this using pgAdmin ... weird special version Dave gave
>>>>>> me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.
>>>>>>
>>>>>
>>>>> I don't think we changed anything in this area. So you should have the
>>>>> same issue with 1.12.
>>>> yes, I have this issue with 1.12.
>>>
>>> Looks like it's getting the OID of the table the index is associated
>>> with rather than just using the indexrelid column from
>>> pg_stat_all_indexes.
>>>
>>
>> You're right. Not sure what I was thinking when I applied this on 1.12.
>> Quick patch (not yet checked):
>>
>> diff --git a/pgadmin/schema/pgIndex.cpp b/pgadmin/schema/pgIndex.cpp
>> index e55daf3..4c2fa23 100644
>> --- a/pgadmin/schema/pgIndex.cpp
>> +++ b/pgadmin/schema/pgIndex.cpp
>> @@ -374,7 +374,7 @@ void pgIndexBase::ShowStatistics(frmMain *form,
>> ctlListView
>>              wxT(", idx_blks_hit AS ") + qtIdent(_("Index Blocks Hit"));
>>
>>     if (GetConnection()->HasFeature(FEATURE_SIZE))
>> -        sql += wxT(", pg_size_pretty(pg_relation_size(") + GetOidStr()
>> + wxT(")
>> +        sql += wxT(", pg_size_pretty(pg_relation_size(indexrelid)) AS
>> ") + qtId
>>
>>     if (showExtendedStatistics)
>>     {
>>
>> If you want to test, it's all yours. Will check tonight and apply if
>> good enough.
>
> Okay, built with change and works fine :)
>

You mean with your changes? because this pseudo-patch doesn't work. I
worked on it yesterday, and found I didn't modify the good method.
Anyway, I have a patch ready to commit.


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Re: wrong indexes sizes on index page

От
Thom Brown
Дата:
On 13 October 2010 08:30, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> Le 13/10/2010 00:35, Thom Brown a écrit :
>> On 12 October 2010 16:19, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>> Le 12/10/2010 14:37, Thom Brown a écrit :
>>>> On 12 October 2010 11:01, Timon <timosha@gmail.com> wrote:
>>>>> 2010/10/12 Guillaume Lelarge <guillaume@lelarge.info>:
>>>>>> Le 12/10/2010 11:47, Thom Brown a écrit :
>>>>>>> On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
>>>>>>>> see attachment.
>>>>>>>> Last column on table shows index size, but 227MB - is table size.
>>>>>>>>
>>>>>>>> postgresql 8.4.4
>>>>>>>>
>>>>>>>> pgadmin 1.13 last dev build from git
>>>>>>>>
>>>>>>>
>>>>>>> I can confirm this using pgAdmin ... weird special version Dave gave
>>>>>>> me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.
>>>>>>>
>>>>>>
>>>>>> I don't think we changed anything in this area. So you should have the
>>>>>> same issue with 1.12.
>>>>> yes, I have this issue with 1.12.
>>>>
>>>> Looks like it's getting the OID of the table the index is associated
>>>> with rather than just using the indexrelid column from
>>>> pg_stat_all_indexes.
>>>>
>>>
>>> You're right. Not sure what I was thinking when I applied this on 1.12.
>>> Quick patch (not yet checked):
>>>
>>> diff --git a/pgadmin/schema/pgIndex.cpp b/pgadmin/schema/pgIndex.cpp
>>> index e55daf3..4c2fa23 100644
>>> --- a/pgadmin/schema/pgIndex.cpp
>>> +++ b/pgadmin/schema/pgIndex.cpp
>>> @@ -374,7 +374,7 @@ void pgIndexBase::ShowStatistics(frmMain *form,
>>> ctlListView
>>>              wxT(", idx_blks_hit AS ") + qtIdent(_("Index Blocks Hit"));
>>>
>>>     if (GetConnection()->HasFeature(FEATURE_SIZE))
>>> -        sql += wxT(", pg_size_pretty(pg_relation_size(") + GetOidStr()
>>> + wxT(")
>>> +        sql += wxT(", pg_size_pretty(pg_relation_size(indexrelid)) AS
>>> ") + qtId
>>>
>>>     if (showExtendedStatistics)
>>>     {
>>>
>>> If you want to test, it's all yours. Will check tonight and apply if
>>> good enough.
>>
>> Okay, built with change and works fine :)
>>
>
> You mean with your changes? because this pseudo-patch doesn't work. I
> worked on it yesterday, and found I didn't modify the good method.
> Anyway, I have a patch ready to commit.

Yes, with my changes, which on glancing at yours, looked roughly the
same, but must be a difference somewhere.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

Re: wrong indexes sizes on index page

От
Thom Brown
Дата:
On 13 October 2010 09:27, Thom Brown <thom@linux.com> wrote:
> On 13 October 2010 08:30, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>> Le 13/10/2010 00:35, Thom Brown a écrit :
>>> On 12 October 2010 16:19, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>> Le 12/10/2010 14:37, Thom Brown a écrit :
>>>>> On 12 October 2010 11:01, Timon <timosha@gmail.com> wrote:
>>>>>> 2010/10/12 Guillaume Lelarge <guillaume@lelarge.info>:
>>>>>>> Le 12/10/2010 11:47, Thom Brown a écrit :
>>>>>>>> On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
>>>>>>>>> see attachment.
>>>>>>>>> Last column on table shows index size, but 227MB - is table size.
>>>>>>>>>
>>>>>>>>> postgresql 8.4.4
>>>>>>>>>
>>>>>>>>> pgadmin 1.13 last dev build from git
>>>>>>>>>
>>>>>>>>
>>>>>>>> I can confirm this using pgAdmin ... weird special version Dave gave
>>>>>>>> me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.
>>>>>>>>
>>>>>>>
>>>>>>> I don't think we changed anything in this area. So you should have the
>>>>>>> same issue with 1.12.
>>>>>> yes, I have this issue with 1.12.
>>>>>
>>>>> Looks like it's getting the OID of the table the index is associated
>>>>> with rather than just using the indexrelid column from
>>>>> pg_stat_all_indexes.
>>>>>
>>>>
>>>> You're right. Not sure what I was thinking when I applied this on 1.12.
>>>> Quick patch (not yet checked):
>>>>
>>>> diff --git a/pgadmin/schema/pgIndex.cpp b/pgadmin/schema/pgIndex.cpp
>>>> index e55daf3..4c2fa23 100644
>>>> --- a/pgadmin/schema/pgIndex.cpp
>>>> +++ b/pgadmin/schema/pgIndex.cpp
>>>> @@ -374,7 +374,7 @@ void pgIndexBase::ShowStatistics(frmMain *form,
>>>> ctlListView
>>>>              wxT(", idx_blks_hit AS ") + qtIdent(_("Index Blocks Hit"));
>>>>
>>>>     if (GetConnection()->HasFeature(FEATURE_SIZE))
>>>> -        sql += wxT(", pg_size_pretty(pg_relation_size(") + GetOidStr()
>>>> + wxT(")
>>>> +        sql += wxT(", pg_size_pretty(pg_relation_size(indexrelid)) AS
>>>> ") + qtId
>>>>
>>>>     if (showExtendedStatistics)
>>>>     {
>>>>
>>>> If you want to test, it's all yours. Will check tonight and apply if
>>>> good enough.
>>>
>>> Okay, built with change and works fine :)
>>>
>>
>> You mean with your changes? because this pseudo-patch doesn't work. I
>> worked on it yesterday, and found I didn't modify the good method.
>> Anyway, I have a patch ready to commit.
>
> Yes, with my changes, which on glancing at yours, looked roughly the
> same, but must be a difference somewhere.

I now see why your one is different.  My change involved a
similar-looking piece of code, but in
pgIndexBaseCollection::ShowStatistics, not
pgIndexBase::ShowStatistics.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

Re: wrong indexes sizes on index page

От
Guillaume Lelarge
Дата:
Le 13/10/2010 10:54, Thom Brown a écrit :
> On 13 October 2010 09:27, Thom Brown <thom@linux.com> wrote:
>> On 13 October 2010 08:30, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>> Le 13/10/2010 00:35, Thom Brown a écrit :
>>>> On 12 October 2010 16:19, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>>> Le 12/10/2010 14:37, Thom Brown a écrit :
>>>>>> On 12 October 2010 11:01, Timon <timosha@gmail.com> wrote:
>>>>>>> 2010/10/12 Guillaume Lelarge <guillaume@lelarge.info>:
>>>>>>>> Le 12/10/2010 11:47, Thom Brown a écrit :
>>>>>>>>> On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
>>>>>>>>>> see attachment.
>>>>>>>>>> Last column on table shows index size, but 227MB - is table size.
>>>>>>>>>>
>>>>>>>>>> postgresql 8.4.4
>>>>>>>>>>
>>>>>>>>>> pgadmin 1.13 last dev build from git
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I can confirm this using pgAdmin ... weird special version Dave gave
>>>>>>>>> me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.
>>>>>>>>>
>>>>>>>>
>>>>>>>> I don't think we changed anything in this area. So you should have the
>>>>>>>> same issue with 1.12.
>>>>>>> yes, I have this issue with 1.12.
>>>>>>
>>>>>> Looks like it's getting the OID of the table the index is associated
>>>>>> with rather than just using the indexrelid column from
>>>>>> pg_stat_all_indexes.
>>>>>>
>>>>>
>>>>> You're right. Not sure what I was thinking when I applied this on 1.12.
>>>>> Quick patch (not yet checked):
>>>>>
>>>>> diff --git a/pgadmin/schema/pgIndex.cpp b/pgadmin/schema/pgIndex.cpp
>>>>> index e55daf3..4c2fa23 100644
>>>>> --- a/pgadmin/schema/pgIndex.cpp
>>>>> +++ b/pgadmin/schema/pgIndex.cpp
>>>>> @@ -374,7 +374,7 @@ void pgIndexBase::ShowStatistics(frmMain *form,
>>>>> ctlListView
>>>>>              wxT(", idx_blks_hit AS ") + qtIdent(_("Index Blocks Hit"));
>>>>>
>>>>>     if (GetConnection()->HasFeature(FEATURE_SIZE))
>>>>> -        sql += wxT(", pg_size_pretty(pg_relation_size(") + GetOidStr()
>>>>> + wxT(")
>>>>> +        sql += wxT(", pg_size_pretty(pg_relation_size(indexrelid)) AS
>>>>> ") + qtId
>>>>>
>>>>>     if (showExtendedStatistics)
>>>>>     {
>>>>>
>>>>> If you want to test, it's all yours. Will check tonight and apply if
>>>>> good enough.
>>>>
>>>> Okay, built with change and works fine :)
>>>>
>>>
>>> You mean with your changes? because this pseudo-patch doesn't work. I
>>> worked on it yesterday, and found I didn't modify the good method.
>>> Anyway, I have a patch ready to commit.
>>
>> Yes, with my changes, which on glancing at yours, looked roughly the
>> same, but must be a difference somewhere.
>
> I now see why your one is different.  My change involved a
> similar-looking piece of code, but in
> pgIndexBaseCollection::ShowStatistics, not
> pgIndexBase::ShowStatistics.
>

Exactly :)


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Re: wrong indexes sizes on index page

От
Guillaume Lelarge
Дата:
Le 13/10/2010 11:03, Guillaume Lelarge a écrit :
> Le 13/10/2010 10:54, Thom Brown a écrit :
>> On 13 October 2010 09:27, Thom Brown <thom@linux.com> wrote:
>>> On 13 October 2010 08:30, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>> Le 13/10/2010 00:35, Thom Brown a écrit :
>>>>> On 12 October 2010 16:19, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>>>> Le 12/10/2010 14:37, Thom Brown a écrit :
>>>>>>> On 12 October 2010 11:01, Timon <timosha@gmail.com> wrote:
>>>>>>>> 2010/10/12 Guillaume Lelarge <guillaume@lelarge.info>:
>>>>>>>>> Le 12/10/2010 11:47, Thom Brown a écrit :
>>>>>>>>>> On 12 October 2010 10:29, Timon <timosha@gmail.com> wrote:
>>>>>>>>>>> see attachment.
>>>>>>>>>>> Last column on table shows index size, but 227MB - is table size.
>>>>>>>>>>>
>>>>>>>>>>> postgresql 8.4.4
>>>>>>>>>>>
>>>>>>>>>>> pgadmin 1.13 last dev build from git
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I can confirm this using pgAdmin ... weird special version Dave gave
>>>>>>>>>> me last week ... against PostgreSQL 8.3.1, and PostgreSQL 9.0.0.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I don't think we changed anything in this area. So you should have the
>>>>>>>>> same issue with 1.12.
>>>>>>>> yes, I have this issue with 1.12.
>>>>>>>
>>>>>>> Looks like it's getting the OID of the table the index is associated
>>>>>>> with rather than just using the indexrelid column from
>>>>>>> pg_stat_all_indexes.
>>>>>>>
>>>>>>
>>>>>> You're right. Not sure what I was thinking when I applied this on 1.12.
>>>>>> Quick patch (not yet checked):
>>>>>>
>>>>>> diff --git a/pgadmin/schema/pgIndex.cpp b/pgadmin/schema/pgIndex.cpp
>>>>>> index e55daf3..4c2fa23 100644
>>>>>> --- a/pgadmin/schema/pgIndex.cpp
>>>>>> +++ b/pgadmin/schema/pgIndex.cpp
>>>>>> @@ -374,7 +374,7 @@ void pgIndexBase::ShowStatistics(frmMain *form,
>>>>>> ctlListView
>>>>>>              wxT(", idx_blks_hit AS ") + qtIdent(_("Index Blocks Hit"));
>>>>>>
>>>>>>     if (GetConnection()->HasFeature(FEATURE_SIZE))
>>>>>> -        sql += wxT(", pg_size_pretty(pg_relation_size(") + GetOidStr()
>>>>>> + wxT(")
>>>>>> +        sql += wxT(", pg_size_pretty(pg_relation_size(indexrelid)) AS
>>>>>> ") + qtId
>>>>>>
>>>>>>     if (showExtendedStatistics)
>>>>>>     {
>>>>>>
>>>>>> If you want to test, it's all yours. Will check tonight and apply if
>>>>>> good enough.
>>>>>
>>>>> Okay, built with change and works fine :)
>>>>>
>>>>
>>>> You mean with your changes? because this pseudo-patch doesn't work. I
>>>> worked on it yesterday, and found I didn't modify the good method.
>>>> Anyway, I have a patch ready to commit.
>>>
>>> Yes, with my changes, which on glancing at yours, looked roughly the
>>> same, but must be a difference somewhere.
>>
>> I now see why your one is different.  My change involved a
>> similar-looking piece of code, but in
>> pgIndexBaseCollection::ShowStatistics, not
>> pgIndexBase::ShowStatistics.
>>
>
> Exactly :)
>

Finally commited. Thanks, Timon and Thom.


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com