Cm:select - howo to use distinct and such

Hello:
I need to do
SELECT DISTINCT object_name FROM
content
How do I do that using cm:select?
Is there a document anywhere that would explain the cm:select query
language syntax?
Any help is appreciated
Thanks

Hi Gennadiy,
Unfortunately, what you want to do cannot be done via the cm:select tag, nor
any of the standard public APIs. As was mentioned previously, if you were
using the reference implementation, you could execute a SQL statement
against the commercePool which looked like:
SELECT DISTINCT AUTHOR FROM WLCS_DOCUMENT
or:
SELECT DISTINCT VALUE FROM WLCS_DOCUMENT_METADATA
WHERE NAME = 'the name of the property you want'
With Documentum, that obviously won't work. However, when you setup WLPS
2.0.1 with Documentum, you configure a JDBC connection pool (dctmPool) that
utilizes the Documentum JDBC driver. You can execute DQL select statements
through this. Also, the Documentum Foundation Classes (DFC) are shipped
with the Documentum WLPS integration piece, so those could be used.
Questions related to how to use DQL or DFC should be directed to Documentum
support.
Regards,
Ginny Peterson
BEA Systems, Inc.
"Gennadiy Civil" <[email protected]> wrote in message
news:[email protected]...
Thanks BUT --
I did read the documentation and there is no way I could find to do what I
need to do..
I need to get a list of certain attributes from the content repository,not
just from the arbitrary database.
The documents in the repository have certain attributes - for example"autor"
- so I need to get all the authors the documents have so I can buildbrowse by
author drop down list.
cm:select only allows me to get list of documents where for example author
like "Asimov".
So hence my question - how do I get a list of all possible non repeated
authors from the repositiory.
Thanks
Gennadiy
"néné" wrote:
Hi Gennadiy,
The <cm:select ...> tag is used to get information from the Content
Management source.
You can see the details of this tag at the following documentation URL:
http://edocs.beasys.com/wlcs/p13ndev/jsptags.htm#1057716
If you want to get info from the database, and want to use a SQL
statement
such as "SELECT DISTINCT object_name FROM ...", you should probably look
into the <es:preparedstatement ...>
tag.
Check the documentation for the <cm:select ...> tag. There just mightbe
enough info there to help you out!

Similar Messages

  • Using distinct and orderby in the select statment

    Hi All,
    Can anyone tell me what is the purpose of using distinct and orderby in the select statment.

    Hi,
    Using the distinct function with more than one column yields some substantial results. SQL will return the rows with distinct or unique combinations of those columns. Assume this same employee table has another column including the salary of each employee. With the use of the distinct function we can pull a list of unique job titles - salaries.
    SQL Code:
    SELECT DISTINCT job_titles, salary FROM employees;
    SQL has returned all the rows with unique combinations of job titles and salaries. Any duplicate combinations of job titles and salaries will be ignored. For example if we had two CEOs in the table making the same salary each year, only one row would be returned but if we had two CEOs with different salaries, both rows would be returned.
    Order by
    The SQL ORDER BY clause comes in handy when you want to sort your SQL result sets by some column(s). For example if you want to select all the persons from the already familiar Customers table and order the result by date of birth, you will use the following statement:
    SELECT * FROM Customers
    ORDER BY DOB
    As you can see the rows are sorted in ascending order by the DOB column, but what if you want to sort them in descending order? To do that you will have to add the DESC SQL keyword after your SQL ORDER BY clause:
    SELECT * FROM Customers
    ORDER BY DOB DESC
    If you don't specify how to order your rows, alphabetically or reverse, than the result set is ordered alphabetically, hence the following to SQL expressions produce the same result:
    SELECT * FROM Customers
    ORDER BY DOB
    SELECT * FROM Customers
    ORDER BY DOB ASC
    You can sort your result set by more than one column by specifying those columns in the SQL ORDER BY list. The following SQL expression will order by DOB and LastName:
    SELECT * FROM Customers
    ORDER BY DOB, LastName
    if its useful reward points

  • SSRS reporting with sharepoint list using Distinct and Multivalue parameters

    i want create ssrs report with sharepoint list using ms-vs(2008). i want create Distinct multivalue parameters by using CAML query. There is any way we put CAML query where we use Distinct keyword and IN clause in CAML query... i hope all experts will
    understand my poor English... sorry for poor English.. plz help me

    Hi AsifMehmood,
    Per my understanding you have create an SSRS report with SharePoint list, now you don’t know to create the distinct parameters by using CAML query,  right?
    For the CAML language doesn’t have any reserved word (or tag) to set this particular filter to remove duplicate results, but we can use the custom code to do this function. I have tested on my local environment and we can do that by create one hidden parameter(Param1)
    to get all the values from the fields which will  add the filter and then create another parameter(Param2) to get the distinct values based on the Param1, we use the custom code to do the deduplication.
    Step by Steps information in below thread for your reference to create the parameters and the custom code:
    "How to get distinct values of sharepoint column using SSRS"
    Other similar thread for your reference:
    https://audministrator.wordpress.com/2014/02/17/sharepoint-list-add-distinct-parameter-value/
    If your problem still exists, please feel free to ask and also try to provide us more details information.
    Regards
    Vicky Liu

  • Using DISTINCT and COUNT together.

    So I have a query which I dicovered is not quite working as planned.
    SELECT DISTINCT NULL LINK,
           TO_CHAR(MONTHS_,'YYYY-MM') DATIME,
           sum(decode(CMS.CMS_NODE_OS.OS_TYPE,'Linux','1',0))"Linux" FROM
      ( SELECT ADD_MONTHS(TRUNC(to_date('28-FEB-2013','DD-MON-YYYY'),'MM'),-ROWNUM + 1) MONTHS_ FROM DUAL CONNECT BY LEVEL <=
      (SELECT CEIL( MONTHS_BETWEEN(to_date('28-FEB-2013','DD-MON-YYYY'),TO_DATE('01-FEB-2013','DD-MON-YYYY'))) FROM DUAL) )
    THE_TIMELINE
      LEFT JOIN CMS.CMS_NODE ON ( MONTHS_ BETWEEN CREATE_DT AND LAST_DAY(NVL(RETIRE_DT,MONTHS_)))
      LEFT JOIN CMS.CMS_NODE_OS ON CMS.CMS_NODE.NODE_NAME=CMS.CMS_NODE_OS.NODE_NAME
      WHERE CMS.CMS_NODE.NODE_ENV<>'Alias' and CMS.CMS_NODE_OS.OS_TYPE='Linux' GROUP BY (TO_CHAR(MONTHS_,'YYYY-MM')) ORDER BY DATIMEThe issue that I'm having is that on the LEFT JOIN of the CMS_NODE_OS table that there a mulitple join records. I just want to have one joined. because of the GROUP and SUM the DISTINCT is rendered null and void.(returns 961) when it should be like (737) records.
    How can I just link one CMS_NODE_OS record per CMS_NODE record...

    Hi,
    bostonmacosx wrote:
    ... The issue that I'm having is that on the LEFT JOIN of the CMS_NODE_OS table that there a mulitple join records. I just want to have one joined. because of the GROUP and SUM the DISTINCT is rendered null and void.(returns 961) when it should be like (737) records.That sounds like a Chasm Trap .
    How can I just link one CMS_NODE_OS record per CMS_NODE record...Which one?
    If you can write an ORDER BY clause that would put that row first, then you can use the analytic ROW_NUMBER function. Instead of joining to CMS_NODE_OS, join to a sub-query that has the relevant columns from CMS_NODE_OS, as well as ROW_NUMBER (let's call that column r_num). Include "AND r_num = 1" in the join condition.
    That's just one way to deal with a chasm trap. Depending on your data and your requirements, there may be better ways.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    You'll get better answers faster if you always supply this information whenever you post a question.

  • Using distinct and sequences

    I have a problem that I'm sure has a simple solution.
    I'm trying to insert unique records into one table from another table that has duplicates. However, I cant use the sequence for my primary key with the distinct operator. eg.:
    INSERT INTO unique_table (pkey,fkey,name)
    SELECT DISTINCT seq.nextval, col1, col2
    FROM dup_table;
    it is the combination of fields col1 and col2 that must be unique. Please help.

    correct, the distinct clause returns unique rows. you could
    create a trigger for your table then just insert your dup_tab
    into the uniq_tab
    insert into uniq_tab (select distinct col1,col2 from dup_tab);
    with the trigger, your dup_tab will be populated with uniq
    rows on col1,col2
    Hope this helps
    Jay

  • Select multiple tabs using keyboard and mouse

    Simply put, I used to be able to select multiple tabs byt haveing one selected, holding down the Ctrl + Shift keys, and then clicking on the last tab I wanted to be added to the selection.
    That function seems to have disappeared, is there any way to recover it?

    Hi 1031982!
    Were you using the Multiple Tab Handler add-on? If so, it seems it's not yet fully compatible with the latest version of Firefox (you can check some of the comments here on the add-ons page: https://addons.mozilla.org/en-US/firefox/addon/multiple-tab-handler/ ).

  • Using Concat and Distinct together

    hi
    I am using the query below and I am getting 'missing expression' error. How do use Distinct and concat together?
    SELECT 'SELECT ' || DISTINCT COLUMN || ' FROM DUAL UNION ALL '
    FROM TABLE;

    Hi,
    SeshuGiri wrote:
    hi
    I am using the query below and I am getting 'missing expression' error. How do use Distinct and concat together?
    SELECT 'SELECT ' || DISTINCT COLUMN || ' FROM DUAL UNION ALL '
    FROM TABLE;Whenever you have a problem, please post CREATE TABLE and INSERT statments for a little sample data, and the results you want from that data.
    The example you posted has so many mistakes, it's hard to know what you're trying to do.
    COLUMN, DISTINCT and TABLE are all Oracle keywords, and shouldn't be used for actual columnor table names, and using them for aliases is just asking for trouble.
    When using SELECT DISTINCT, the keyword DISTINCT must come immediately after SELECT.
    If you want to assign an alias to a column, it must be at the very end of the expression that defines the column. You can't assign an alias to part of an expression. If you want to do that, use a sub-query.
    Here's a query that uses both SELECT DISTINCT and ||:
    SELECT DISTINCT
            job || deptno    AS jd
    FROM    scott.emp;Edited by: Frank Kulash on May 13, 2011 2:52 PM

  • Select images using keywords and view slideshow...using what?

    I have a library full of jpeg images that were created either using the export command from LR or by editing in Br/Ps and then savedAs jpeg. Now I want to watch slideshows on my monitor (30" Apple HD Cinema Display). Now I have the following Dilemma:
    - I can start a Search Command in Bridge and narrow it down to exactly the images I want in my slide show. Then from the View menu select Slideshow. The IQ is terrible. True sharpness is only revealed when zooming in 100% but that's not the idea of a slide show.
    - I can also use Apple OS's (Tiger) built-in slide show and start it from the finder. That way I get high quality, fast dissolving slide shows, that are unfortunately limited to the first 100 images in the Finder view. However, in the Finder I cannot select my images using keywords and IPTC info.
    So could there be a simple solution to the problems I'm running into with Bridge?
    Or could there be a nice viewer for MacOS that features the search option I want and renders good images and dissolve option?
    Thanks.

    @Ann Shelbourne: Thanks for your reply. I'm hesitant to upgrade to CS4 at this point. That would mean my only option is to look for a jpeg viewer other than Adobe that can select images based on keywords and iptc data. Would you know one that does?
    @Ramon G Castaneda: I apologise for being an inexperienced forum visitor. I will take note of your advice and follow the posting instructions.
    I checked FAQ's both here and at Adobe, as well as the knowledge base. No results. I also searched the forum.
    My setup: MPB dual core Intel, 2GB RAM, 30GB free disk space. Adobe CS3, just updated to Bridge version 2.1.1.9. No improvement at all so far. According to Ann only CS4 will solve the problem.
    Thank you.

  • Issue in select of billing documents from VBRK using FKART and FKDAT

    Hi All,
    I have to select the billing documents VBELN using the billing date and billing type.
    As both are not key fields , im unable to perform such select .
    How can get billing documents using these fields. Is there any other table where i can use these fields as key fields ?
    Can i use indexes ?
    Kindly help .... plz reply ..
    Edited by: ujjwal_d15 on Apr 15, 2011 12:55 PM

    HI,
    if u  will use date in the select query it will decrease the performance of your program as there isno secodnary index on the date field
    so it wud be better if you can select the data using just billing type and then once all the records in the internal table
    using delte statement to delte all the records that are out of the date range,
    this wont affect the performance of your system and the query will take less time to fetch the data,deletion takes onlyfew miliseconds to clear unwanted data

  • Select distinct and 2 inner joins in same select statement

    can anyone guide me how to write the below query for higher performance. can I use for all entires or shall i split this,
    please let me know your opinions.
    SELECT DISTINCT werks matnr b~stlal idnrk postp d~aennr
       sortf potx1 c~lkenz b~stlty stlst
       INTO TABLE ltab_one
       FROM mast AS a INNER JOIN stko AS b
         ON  a~stlnr = b~stlnr
         AND a~stlal = b~stlal
         INNER JOIN stas AS c
         ON  b~stlnr = c~stlnr
         AND b~stlal = c~stlal
         AND b~stlty = c~stlty
         INNER JOIN stpo AS d
         ON  c~stlnr = d~stlnr
         AND c~stlkn = d~stlkn
         AND c~stlty = d~stlty
      WHERE a~werks IN s_werks
         AND ( ( d~andat IN s_datum
            OR d~aedat IN s_datum
            OR a~andat IN s_datum
            OR a~aedat IN s_datum
            OR b~andat IN s_datum
            OR b~aedat IN s_datum
            OR c~andat IN s_datum
            OR c~aedat IN s_datum
            ) AND d~datuv >= lv_effdt )
         AND a~stlan = '1'
         AND matnr IN s_matnr.

      WHERE a~werks IN s_werks
         AND ( ( d~andat IN s_datum
            OR d~aedat IN s_datum
            OR a~andat IN s_datum
            OR a~aedat IN s_datum
            OR b~andat IN s_datum
            OR b~aedat IN s_datum
            OR c~andat IN s_datum
            OR c~aedat IN s_datum
            ) AND d~datuv >= lv_effdt )
         AND a~stlan = '1'
         AND matnr IN s_matnr.
    This part determines your performance, not the DISTINCT and not the joins.
    What is in s_werks, s-datum, s_matnr typically? I guess there are better and worse conditions.

  • Oracle: slow performance with SELECT using ojdbc14 and connection pooling

    Hello,
    i'm working hard the last days to solve a performance problem with our customer using a oracle 10g database. For testing I used our oracle 9.2.0.1.0 database which shows the same symptoms. All doing solved nothing: the performance while using this oracle is much slower than other databases. This result I cannot trust and so I need some advice. What is missing to improve the performance on the java side?
    The webapplication I use runs fast on MySQL 4.x and SQLServer 2000, but on the above mentioned Oracle it was always 4 times slower. The webapplication uses a lot of simple SELECT-Statements without complicated joins and so on (because it should run on many different databases). Doing some days of creating tests within this webapplication, I was not able to find any entrance point for a change. All databases server I'm using, having only the default configurations after a common installation.
    To reduce the complexity I wrote a simple java application with connection pooling using only the latest libraries from apache-commons(dbcp, pool), and the latest ojdbc14 for oracle 9.2.
    First the results than the code: MySQL needed less than 1000 millisecond, SQLServer around 1000 milliseconds and Oracle over 2000 milliseconds. I stopped pooling and the results are for Oracle even worse: over 18000 milliseconds (mysql:2500, sqlserver:4100).
    I changed the classes for Oracle and used the class oracle.jdbc.pool.OracleConnectionCacheImpl from the ojdbc14-library. No difference (around 100 milliseconds more or less).
    The only Select-Statement works on this table, which has one index on HICTGID.
    It contains 259 entrances.:
    CREATE TABLE HIERARCHYCATEGORY (
      HICTGID                 NUMBER (19)   NOT NULL,
      HICTGLEVEL              NUMBER (10)   NOT NULL,
      HICTGEXTID              NUMBER (19)   NOT NULL,
      HICTGEXTPARENTID        NUMBER (19)   NOT NULL,
      HICTGNAME               VARCHAR2(255) NOT NULL
    );The application simply loops through this table using
    SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?, but I always open a connection before this query and closes this connection afterwards. So I use the pooling as much as possible. That's all SQL I'm using.
        protected static DataSource setupDataSource(String sDriver, String sUrl, String sUser, String sPwd) throws SQLException {
            BasicDataSource ds = new BasicDataSource();
            ds.setDriverClassName(sDriver);
            ds.setUsername(sUser);
            ds.setPassword(sPwd);
            ds.setUrl(sUrl);
            // The maximum number of active connections:
            ds.setMaxActive(3);
            // The maximum number of active connections that can remain idle in the pool,
            // without extra ones being released, or zero for no limit:
            ds.setMaxIdle(3);
            // The maximum number of milliseconds that the pool will wait (when there are no available connections)
            // for a connection to be returned before throwing an exception, or -1 to wait indefinitely:
            ds.setMaxWait(3000);    
            return ds;
        }I can switch by using external properties between three databases (oracle, mysql and sqlserver) and if I want I can switch pooling off. And all actions I'm interested are logged by Log4J.
        public static Connection getConnection() throws SQLException {
            Connection result = null;
            String sJdbcDriver = m_oJbProp.getString("jdbcDriver");
            String sJdbcUrl = m_oJbProp.getString("databaseConnection");
            String sJdbcUser = m_oJbProp.getString("dbUsername");
            String sJdbcPwd = m_oJbProp.getString("dbPassword");
                try {
                    if (m_oJbProp.getString("useConnectionPooling").equals("true")) {
                         if (log.isDebugEnabled()) {
                              log.debug("ConnectionPooling true");
                        if(null == m_ds) {
                            m_ds = setupDataSource(sJdbcDriver,sJdbcUrl,sJdbcUser,sJdbcPwd);
                              if (log.isDebugEnabled()) {
                                   log.debug("DataSource created");
                        result = m_ds.getConnection();
                    } else {
                        // No connection pooling:
                         if (log.isDebugEnabled()) {
                              log.debug("ConnectionPooling false");
                        try {
                            Class.forName(sJdbcDriver);
                            result = DriverManager.getConnection(sJdbcUrl, sJdbcUser, sJdbcPwd);
                        } catch (ClassNotFoundException cnf) {
                            log.error("Exception: Class Not Found. ", cnf);
                            System.exit(0);
    (.. ErrorHandling ...)Here is the code fragment which is doing the work:
                     StringBuffer sb = new StringBuffer();
                while (lNextBottom <= lNextCeiling) {
                     con = getConnection();
                     innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
                     innerSelStmt.setLong(1, lNextBottom);
                     rsInner = innerSelStmt.executeQuery();
                     if ((rsInner != null) && (rsInner.next())) {
                         sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
                          if (log.isDebugEnabled()) {
                               log.debug("Inner Statement: " + rsInner.getLong(1) + "\r");
                     rsInner.close();
                     con.close();
                     lNextBottom++;
                 if (log.isInfoEnabled()) {
                      log.info("\rResult values: Hictgid, Hictgname \r");
                      log.info(sb.toString());
                 }and the main method:
        public static void main(String[] args) {
            try {
                 long lStartTime = System.currentTimeMillis();
                 JdbcBasic oJb = new JdbcBasic();
                 boolean bSuccess = false;
                 bSuccess = oJb.getHierarchycategories();
                 if (log.isInfoEnabled()) {
                      log.info("Running time: " + (System.currentTimeMillis() - lStartTime));
                 if (null != m_ds) {
                     printDataSourceStats(m_ds);
                      shutdownDataSource(m_ds);
                      if (log.isInfoEnabled()) {
                           log.info("Datasource closed.");
             } catch (SQLException sqe) {
                  log.error("SQLException within  main-method", sqe);
        }My database values are
    databaseConnection=jdbc:oracle:thin:@SERVERDB:1521:ora
    jdbcDriver=oracle.jdbc.driver.OracleDriver
    databaseConnection=jdbc:jtds:sqlserver://SERVERDB:1433/testdb
    jdbcDriver=net.sourceforge.jtds.jdbc.Driver
    databaseConnection=jdbc:mysql://localhost/testdb
    jdbcDriver=com.mysql.jdbc.Driver
    dbUsername=testusr
    dbPassword=testpwdThanks for your reading and maybe for your help.

    A few comments.
    There is of course another difference between your test cases then just the database. There is also the driver. And I suspect that in at least the case with the jtds driver it is helping you along where you are doing something silly and the Oracle driver is not.
    Before I explain the next part I would say the speed differences between MS-SQL and MySQL look about right I think you are aiming here for MS-SQL level performance not MySQL. (For a bunch of reasons MySQL is inherently faster but there are MANY drawbacks as well which have been well discussed on previous threads)
    Here is where I believe your problem lies
    while (lNextBottom <= lNextCeiling) {
                     con = getConnection();
                     innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
                     innerSelStmt.setLong(1, lNextBottom);
                     rsInner = innerSelStmt.executeQuery();
                     if ((rsInner != null) && (rsInner.next())) {
                         sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
                          if (log.isDebugEnabled()) {
                               log.debug("Inner Statement: " + rsInner.getLong(1) + "\r");
                     rsInner.close();
                     con.close();
                     lNextBottom++;
                 }There at least four things that are wrong with above.
    1) Why are you preparing the statement INSIDE the loop. Let us for a moment say that the loop will spin 100 times. That means that you are preparing the same statement 100 times. This is bad. It is also very relevant because for example the Jtds driver is going to be caching the prepared statements you make so that actually while you try and prepare it 100 times it only actually does it once... but in Oracle I don't know what it is doing for sure but if it is preparing on each pass well than that bit of it is going take 100 times longer then it should.
    2) You are opening and closing the connection on each pass through the loop... also a terrible idea. You need to fix this first so that you can repeatedly use the same prepared statement.
    3) Why are you looping in the first place? More on this later.
    4) Where do you close the PreparedStatement? It doesn't look like you do.
    Okay so for starters your loop should look a lot more like this...
    code]
    con = getConnection();
    innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
    while (lNextBottom <= lNextCeiling) {
    innerSelStmt.setLong(1, lNextBottom);
    rsInner = innerSelStmt.executeQuery();
    if ((rsInner != null) && (rsInner.next())) {
    sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
    rsInner.close();
    lNextBottom++;
    innerSelStmt.close();
    con.close();
    I think the code above (and you can put your debug stuff back if you want) which uses ONE connection and ONE prepared Statement will improve your performance dramatically.
    The other question though I would as is why in the hell you are doing 100 or whatever number of queries anyway. This can be done all in ONE query which again will improve performance.
    Your query and such should look like this I think.
    String sql = "SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID >=? AND HICTGID<=?";
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setLong(1,lNextBottom );
    ps.setLong(2,lNextCeiling);
    ResultSet rs = ps.executeQuery();
    while(rs.next()){
      // your appending to string buffer code goes here
    }and I can't understand why you're not doing that in the first place.

  • I am trying to delete pages from a PDF file. I opened the bookmarks, selected the pages to delete and choose Edit Delete. The selected pages are not deleted. Note: I have to open the file using a passport provided by an external party.

    I am trying to delete pages from a PDF file. I opened the bookmarks in the PDF file, selected the pages to delete and choose Edit > Delete. The selected pages are not deleted. Note: I have to open the file using a passport provided by an external party.

    Resolved

  • Poor performance when Distinct and Order By Used

    Hello,
    I am getting an slow answer when I add Distinct and Order By to the query:
    Without Distinct and Order By lasts 3.57 seconds; without Distinct and Order By lasts 28.15 seconds, which it's too much for our app.
    The query is:
    select distinct CC.acceso, CC.ext_acceso, TIT.TITULO_SALIDA
    from (((Ocurrencias CT01 inner join
    palabras p0 on (CT01.cod_palabra = p0.cod_palabra and p0.palabra like 'VENEZUELA%' AND p0.campo = 'AUTOR')) INNER JOIN
    CENTRAL CC ON (CT01.ACCESO = CC.ACCESO AND CT01.EXT_ACCESO = CC.EXT_ACCESO))) inner join
    codtit ctt on (CC.acceso = ctt.acceso and CC.ext_acceso = ctt.ext_acceso) inner join
    titulos tit on (ctt.cod_titulo = tit.cod_titulo and ctt.portada = '1')
    where CC.nivel_reg <> 's'
    ORDER BY 3 ASC;
    The query plan for the query WITH Distinct and Order By is:
    Elapsed: 00:00:28.15
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=301 Card=47 Bytes=12220)
    1 0 SORT (ORDER BY) (Cost=301 Card=47 Bytes=12220)
    2 1 SORT (UNIQUE) (Cost=300 Card=47 Bytes=12220)
    3 2 NESTED LOOPS (Cost=299 Card=47 Bytes=12220)
    4 3 NESTED LOOPS (Cost=250 Card=49 Bytes=4165)
    5 4 NESTED LOOPS (Cost=103 Card=49 Bytes=2989)
    6 5 NESTED LOOPS (Cost=5 Card=49 Bytes=1960)
    7 6 TABLE ACCESS (BY INDEX ROWID) OF 'PALABRAS' (TABLE) (Cost=3 Card=1 Bytes=19)
    8 7 INDEX (RANGE SCAN) OF 'PALABRA' (INDEX (UNIQUE)) (Cost=2 Card=1)
    9 6 INDEX (RANGE SCAN) OF 'PK_OCURRENCIAS' (INDEX (UNIQUE)) (Cost=2 Card=140 Bytes=2940)
    10 5 TABLE ACCESS (BY INDEX ROWID) OF 'CENTRAL' (TABLE) (Cost=2 Card=1 Bytes=21)
    11 10 INDEX (UNIQUE SCAN) OF 'PK_CENTRAL' (INDEX (UNIQUE)) (Cost=1 Card=1)
    12 4 TABLE ACCESS (BY INDEX ROWID) OF 'CODTIT' (TABLE) (Cost=3 Card=1 Bytes=24)
    13 12 INDEX (RANGE SCAN) OF 'PK_CODTIT' (INDEX (UNIQUE)) (Cost=2 Card=1)
    14 3 TABLE ACCESS (BY INDEX ROWID) OF 'TITULOS' (TABLE) (Cost=1 Card=1 Bytes=175)
    15 14 INDEX (UNIQUE SCAN) OF 'PK_TITULOS' (INDEX (UNIQUE)) (Cost=0 Card=1)
    Statistics
    154 recursive calls
    0 db block gets
    32070 consistent gets
    1622 physical reads
    0 redo size
    305785 bytes sent via SQL*Net to client
    2807 bytes received via SQL*Net from client
    212 SQL*Net roundtrips to/from client
    10 sorts (memory)
    0 sorts (disk)
    3149 rows processed
    The query plan for the query WITHOUT Distinct and Order By is:
    Elapsed: 00:00:03.57
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=299 Card=47 Bytes=12220)
    1 0 NESTED LOOPS (Cost=299 Card=47 Bytes=12220)
    2 1 NESTED LOOPS (Cost=250 Card=49 Bytes=4165)
    3 2 NESTED LOOPS (Cost=103 Card=49 Bytes=2989)
    4 3 NESTED LOOPS (Cost=5 Card=49 Bytes=1960)
    5 4 TABLE ACCESS (BY INDEX ROWID) OF 'PALABRAS' (TABLE) (Cost=3 Card=1 Bytes=19)
    6 5 INDEX (RANGE SCAN) OF 'PALABRA' (INDEX (UNIQUE)) (Cost=2 Card=1)
    7 4 INDEX (RANGE SCAN) OF 'PK_OCURRENCIAS' (INDEX (UNIQUE)) (Cost=2 Card=140 Bytes=2940)
    8 3 TABLE ACCESS (BY INDEX ROWID) OF 'CENTRAL' (TABLE) (Cost=2 Card=1 Bytes=21)
    9 8 INDEX (UNIQUE SCAN) OF 'PK_CENTRAL' (INDEX (UNIQUE)) (Cost=1 Card=1)
    10 2 TABLE ACCESS (BY INDEX ROWID) OF 'CODTIT' (TABLE) (Cost=3 Card=1 Bytes=24)
    11 10 INDEX (RANGE SCAN) OF 'PK_CODTIT' (INDEX (UNIQUE)) (Cost=2 Card=1)
    12 1 TABLE ACCESS (BY INDEX ROWID) OF 'TITULOS' (TABLE) (Cost=1 Card=1 Bytes=175)
    13 12 INDEX (UNIQUE SCAN) OF 'PK_TITULOS' (INDEX (UNIQUE)) (Cost=0 Card=1)
    Statistics
    3376 recursive calls
    0 db block gets
    33443 consistent gets
    1061 physical reads
    0 redo size
    313751 bytes sent via SQL*Net to client
    2807 bytes received via SQL*Net from client
    422 SQL*Net roundtrips to/from client
    90 sorts (memory)
    0 sorts (disk)
    3149 rows processed
    I would appreciate a lot if somebody can tell me how to improve the performance of the query with Distinct and Order By.
    Thank you very much,
    Icaro Alzuru C.

    Hello,
    I am getting an slow answer when I add Distinct and Order By to the query:
    Without Distinct and Order By lasts 3.57 seconds; without Distinct and Order By lasts 28.15 seconds, which it's too much for our app.
    The query is:
    select distinct CC.acceso, CC.ext_acceso, TIT.TITULO_SALIDA
    from (((Ocurrencias CT01 inner join
    palabras p0 on (CT01.cod_palabra = p0.cod_palabra and p0.palabra like 'VENEZUELA%' AND p0.campo = 'AUTOR')) INNER JOIN
    CENTRAL CC ON (CT01.ACCESO = CC.ACCESO AND CT01.EXT_ACCESO = CC.EXT_ACCESO))) inner join
    codtit ctt on (CC.acceso = ctt.acceso and CC.ext_acceso = ctt.ext_acceso) inner join
    titulos tit on (ctt.cod_titulo = tit.cod_titulo and ctt.portada = '1')
    where CC.nivel_reg <> 's'
    ORDER BY 3 ASC;
    The query plan for the query WITH Distinct and Order By is:
    Elapsed: 00:00:28.15
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=301 Card=47 Bytes=12220)
    1 0 SORT (ORDER BY) (Cost=301 Card=47 Bytes=12220)
    2 1 SORT (UNIQUE) (Cost=300 Card=47 Bytes=12220)
    3 2 NESTED LOOPS (Cost=299 Card=47 Bytes=12220)
    4 3 NESTED LOOPS (Cost=250 Card=49 Bytes=4165)
    5 4 NESTED LOOPS (Cost=103 Card=49 Bytes=2989)
    6 5 NESTED LOOPS (Cost=5 Card=49 Bytes=1960)
    7 6 TABLE ACCESS (BY INDEX ROWID) OF 'PALABRAS' (TABLE) (Cost=3 Card=1 Bytes=19)
    8 7 INDEX (RANGE SCAN) OF 'PALABRA' (INDEX (UNIQUE)) (Cost=2 Card=1)
    9 6 INDEX (RANGE SCAN) OF 'PK_OCURRENCIAS' (INDEX (UNIQUE)) (Cost=2 Card=140 Bytes=2940)
    10 5 TABLE ACCESS (BY INDEX ROWID) OF 'CENTRAL' (TABLE) (Cost=2 Card=1 Bytes=21)
    11 10 INDEX (UNIQUE SCAN) OF 'PK_CENTRAL' (INDEX (UNIQUE)) (Cost=1 Card=1)
    12 4 TABLE ACCESS (BY INDEX ROWID) OF 'CODTIT' (TABLE) (Cost=3 Card=1 Bytes=24)
    13 12 INDEX (RANGE SCAN) OF 'PK_CODTIT' (INDEX (UNIQUE)) (Cost=2 Card=1)
    14 3 TABLE ACCESS (BY INDEX ROWID) OF 'TITULOS' (TABLE) (Cost=1 Card=1 Bytes=175)
    15 14 INDEX (UNIQUE SCAN) OF 'PK_TITULOS' (INDEX (UNIQUE)) (Cost=0 Card=1)
    Statistics
    154 recursive calls
    0 db block gets
    32070 consistent gets
    1622 physical reads
    0 redo size
    305785 bytes sent via SQL*Net to client
    2807 bytes received via SQL*Net from client
    212 SQL*Net roundtrips to/from client
    10 sorts (memory)
    0 sorts (disk)
    3149 rows processed
    The query plan for the query WITHOUT Distinct and Order By is:
    Elapsed: 00:00:03.57
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=299 Card=47 Bytes=12220)
    1 0 NESTED LOOPS (Cost=299 Card=47 Bytes=12220)
    2 1 NESTED LOOPS (Cost=250 Card=49 Bytes=4165)
    3 2 NESTED LOOPS (Cost=103 Card=49 Bytes=2989)
    4 3 NESTED LOOPS (Cost=5 Card=49 Bytes=1960)
    5 4 TABLE ACCESS (BY INDEX ROWID) OF 'PALABRAS' (TABLE) (Cost=3 Card=1 Bytes=19)
    6 5 INDEX (RANGE SCAN) OF 'PALABRA' (INDEX (UNIQUE)) (Cost=2 Card=1)
    7 4 INDEX (RANGE SCAN) OF 'PK_OCURRENCIAS' (INDEX (UNIQUE)) (Cost=2 Card=140 Bytes=2940)
    8 3 TABLE ACCESS (BY INDEX ROWID) OF 'CENTRAL' (TABLE) (Cost=2 Card=1 Bytes=21)
    9 8 INDEX (UNIQUE SCAN) OF 'PK_CENTRAL' (INDEX (UNIQUE)) (Cost=1 Card=1)
    10 2 TABLE ACCESS (BY INDEX ROWID) OF 'CODTIT' (TABLE) (Cost=3 Card=1 Bytes=24)
    11 10 INDEX (RANGE SCAN) OF 'PK_CODTIT' (INDEX (UNIQUE)) (Cost=2 Card=1)
    12 1 TABLE ACCESS (BY INDEX ROWID) OF 'TITULOS' (TABLE) (Cost=1 Card=1 Bytes=175)
    13 12 INDEX (UNIQUE SCAN) OF 'PK_TITULOS' (INDEX (UNIQUE)) (Cost=0 Card=1)
    Statistics
    3376 recursive calls
    0 db block gets
    33443 consistent gets
    1061 physical reads
    0 redo size
    313751 bytes sent via SQL*Net to client
    2807 bytes received via SQL*Net from client
    422 SQL*Net roundtrips to/from client
    90 sorts (memory)
    0 sorts (disk)
    3149 rows processed
    I would appreciate a lot if somebody can tell me how to improve the performance of the query with Distinct and Order By.
    Thank you very much,
    Icaro Alzuru C.

  • HT204053 i used the same apple id for my iphone and my husbands now all our contacts and such are on both phones how do i fix this.  I dont need his contacts on my phone and the other way also.  Should i create a different icloud account for his phone?

    I used the same apple id for my iphone and my husbands now all our contacts and such are together.  How do I undo this?  Do i create him a different icloud account? 

    Yes, start with deleting your account on his device:
    (Settings > iCloud or Settings > Mail, Contacts, Calendar > Your Account)
    In the next step, create a new account on his device:
    (Settings > iCloud or Settings > Mail, Contacts, Calendar > Your Account)

  • I have 1 old coputer and 1 new 2 different versions of itunes. can they work together. ie can I use the new one to update our iphones and such and if so will our older itunes version8.2 get changed or lost?

    We have two computers. One is older and one is newer. The older has itunes on it (version 8.2) and can no onger update. We want to install itunes on our newer computer to allow us to update our iphones. Can we install 10.2 on the newer computer and use it for updates and such without affecting the older computer? Will my wife be able to still play her music from her older computer and if we buy new music will it upload to both computers.
    Example if she buys ten more songs on her computer(older one) will it automatically upload them to the newer computer when we turn it on? And if I buy a song on the newer computer would it show up on her older version of itunes or not?

    Have a look here...
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l

Maybe you are looking for

  • Copy and paste from one timeline to another results in audio problem

    Hi, I'm trying to create a showreel by copying and pasting segments of edited sequences from the original timeline into a new 'showreel' timeline (in a separate project). I keep having a problem with the audio when I paste the sequence. Dialogue seem

  • E-Mail Setup fails to launch on Nokia X6

    Hello folks, On my Nokia X6, when I try to configure an email account using Nokia Messaging, Email setup fails to launch. I tried configuring from "Messaging" and here after configuring, when I click on "Connect", it doesn't connect. If I select Sett

  • Playback while recording question - help!

    Hi, all! Just started using GB, so forgive me if this has been addressed, but I'd really appreciate the help. Say I have two tracks - I record one guitar track, then I want to record vocals while listening to that guitar track (to sing along). Howeve

  • After clean install of ML 10.8 I am unable to install my Logic Studio 9 Box Set

    I recently did a clean install of ML 10.8 (on version 10.8.2) on my iMac (did a HDD upgrade) When I now try to install my Logic Studio Box Set from the disc I get this error... I don't know of a way to upgrade to the APP Store version from my serial

  • CS4 Install???

    Ok, after going through 2 weeks of trying to get CS3 to install, I must have lost my mind because I am trying now to get CS4 to install. My XP Media Center Computer died and I decided to rebuild it. So XP Media Center with SP3. I have NO Adobe Softwa