Re: Materialized View Patch File

From: Dave Page <dave(dot)page(at)enterprisedb(dot)com>
To: Neel Patel <neel(dot)patel(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Materialized View Patch File
Date: 2013-07-19 09:13:39
Message-ID: CA+OCxowdeVhF2meN3h1+EShiFnrEVM07psXVd7YSjeEJBj0EAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Thanks, patch applied.

On Fri, Jul 19, 2013 at 7:21 AM, Neel Patel <neel(dot)patel(at)enterprisedb(dot)com> wrote:
> Hi Dave,
>
> Thanks for the comment.
>
> We made the changes as you suggested.
>
> Please find the updated patch in attachment and let me know if you have any
> query.
>
> Thanks,
> Neel Patel
>
>
> On Thu, Jul 18, 2013 at 5:54 PM, Dave Page <dave(dot)page(at)enterprisedb(dot)com>
> wrote:
>>
>> Hi
>>
>> I realised this code is all wonky anyway - why is IsMaterializedView()
>> not just an accessor over a pgView private variable that is set in
>> pgViewFactory::CreateObjects when we create the object? We already
>> know at that point whether it's a matview or not (from
>> pg_class.relkind). Querying pg_class every time we want to check if
>> the view is materialized or not is horribly inefficient. There should
>> be just one function, that is a member of pgView and takes no
>> arguments. Whereever it's called, we just need to get the pgView
>> object and call it.
>>
>> Please fix.
>>
>> Thanks.
>>
>> On Thu, Jul 18, 2013 at 5:58 AM, Neel Patel <neel(dot)patel(at)enterprisedb(dot)com>
>> wrote:
>> > Hi Dave,
>> >
>> > Please find the updated patch with modification in query.
>> >
>> > Thanks,
>> > Neel Patel
>> >
>> >
>> > On Wed, Jul 17, 2013 at 5:15 PM, Dave Page <dave(dot)page(at)enterprisedb(dot)com>
>> > wrote:
>> >>
>> >> On Wed, Jul 17, 2013 at 12:23 PM, Neel Patel
>> >> <neel(dot)patel(at)enterprisedb(dot)com> wrote:
>> >> > Hi Dave,
>> >> >
>> >> > Just want to know.
>> >> >
>> >> > Now we are passing GetName() to qtDbString() and to form the complete
>> >> > query
>> >> > we need to use qtDbString() to compare the string.
>> >> >
>> >> > We have added below string.
>> >> >
>> >> > wxString sql = wxT("SELECT count(*) FROM pg_matviews WHERE
>> >> > matviewname =
>> >> > ")
>> >> > + qtDbString(this->GetName()) + wxT(" AND schemaname = ") +
>> >> > qtDbString(this->GetSchema()->GetName());
>> >> >
>> >> > Is it correct ?
>> >>
>> >> I'd expect you to be using GetQuotedIdentifier() there. For a view and
>> >> schema, the identifier is the name anyway.
>> >>
>> >>
>> >> --
>> >> Dave Page
>> >> Chief Architect, Tools & Installers
>> >> EnterpriseDB: http://www.enterprisedb.com
>> >> The Enterprise PostgreSQL Company
>> >>
>> >> Blog: http://pgsnake.blogspot.com
>> >> Twitter: @pgsnake
>> >
>> >
>>
>>
>>
>> --
>> Dave Page
>> Chief Architect, Tools & Installers
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>
>

--
Dave Page
Chief Architect, Tools & Installers
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Neel Patel 2013-07-19 09:14:27 Re: Materialized View Patch File
Previous Message Dave Page 2013-07-19 09:13:22 pgAdmin III commit: Handle materialised views more efficiently, by not