#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    6
    Rep Power
    0

    Smile Postgres xml indexes


    Hi guys,
    I store xml objects in a postgres table: table(xml_id, xml_src)
    example:
    Code:
    <xmlobject>
    <name>james</name>
    <category>3</category>
    <marks>ACTION,HORROR,THRILLER</marks>
    <search_attributes>
    <searchattribute>
      <type>DOUBLE</type>
      <name>Double</name>
    </searchattribute>
    <searchattribute>
      <type>SINGLE</type>
      <name>single</name>
    </searchattribute>
    </search_attributes>
    </xmlobject>
    Now I want to do a full table search. I want to search after category, marks and the search attributes.

    example:
    select all objects where category is 3, marks contains HORROR and ACTION, and the searchattribute contains DOUBLE.

    Performance is very important. Maybe you can give me hints how I have to index. I use xpaths...

    I would be very happy, if there is someone, who can help me...

    thanks and bye
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    6
    Rep Power
    0
    : (
    nobody can give me an advice?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,788
    Rep Power
    349
    Just create the indexes on the expressions you use in your where clause.
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
    http://forums.devshed.com/misc.php?do=bbcode#code

    Tips on how to ask better questions:
    http://tkyte.blogspot.de/2005/06/how-to-ask-questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

IMN logo majestic logo threadwatch logo seochat tools logo