Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7544637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:43:24+00:00 2026-05-30T08:43:24+00:00

I’m being hit hard by the entity-attribute-value antipattern . Some day, years ago, a

  • 0

I’m being hit hard by the entity-attribute-value antipattern. Some day, years ago, a guy decided that DDL wasn’t sexy, and wanted to develop something “flexible enough” to keep information about people. He ignored the fact that people uses to have at least some basic attributes, as name, date of birth, and the like. Not only that, he put a bunch of (side-effects-ridden) PL/SQL packages on top of that schema. The thing managed to be a key subsystem in which other applications relied on.

Fast forward some years and 20 million rows. The guy isn’t at the company anymore, and I have to deal with this. I need to implement some basic searches that right now would require multiple inner joins and just take forever for some cases. Rewriting the whole thing it’s not possible, so I want to “pivot” the most important attributes.

I thought that materialized views could be a viable alternative, but I need some guidance, since I have never used them. I would like to get a table like this:

  select
      uid,
       max(case when att = 'NAME' then UPPER(value) end) name,
       max(case when att = 'SURNAME' then UPPER(value) end) surname,
       max(case when att = 'BIRTH' then DATEORNULL(value) end) birth,
     ....,
     count(*) cnt
 from t
 group by uid

as I understand reading Oracle docs, I should be able to create a “REFRESHABLE ON COMMIT” materialized view with MAX() if the query has no where clause.

But can’t get it to work. I’ve tried:

create materialized view log on t WITH SEQUENCE,ROWID,(value) INCLUDING NEW VALUES;

create materialized view t_view
 refresh fast on commit
 as
  select
      uid,
       max(case when att = 'NAME' then UPPER(value) end) name,
       max(case when att = 'SURNAME' then UPPER(value) end) surname,
       max(case when att = 'BIRTH' then DATEORNULL(value) end) birth,
     count(*) cnt
 from t
 group by uid

It works for inserts, but not for updates. I see that is capable of these things:

  REFRESH_COMPLETE                                                             

  REFRESH_FAST                                                                 

  REFRESH_FAST_AFTER_INSERT

but I think I should see also REFRESH_FAST_AFTER_ONETAB_DML. Any ideas?

Update: Output of dbms_mview.explain_mview

REFRESH_COMPLETE             |Y|
REFRESH_FAST                 |Y|
REFRESH_FAST_AFTER_INSERT    |Y|
REFRESH_FAST_AFTER_ONETAB_DML|N|mv uses the MIN or MAX aggregate functions
REFRESH_FAST_AFTER_ANY_DML   |N|see the reason why REFRESH_FAST_AFTER_ONETAB_DML is disabled
REFRESH_FAST_PCT             |N|PCT is not possible on any of the detail tables in the mater
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:43:26+00:00Added an answer on May 30, 2026 at 8:43 am

    The MV_CAPABILITIES_TABLE.MSGTXT is wrong, what you really need to do is replace case with decode.

    When I tried this on 11g I got the message CASE expressions present in materialized view. Changing it to use decode fixed it on both 10g and 11g.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I need a function that will clean a strings' special characters. I do NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.