Benefits of caching

Hi,
I am trying to analyze the benefits of using a third party O to R
mapping tool which also provides server side caching. If most of my
application(say 75%) is doing batch inserts/updates and doing batch
reads(or otherwise paged reads using a Page by Page Iterator) does
caching really provide benefits in this scenario ? Right now pure JDBC
seems really fast. If we are doing a lot of single row reads does it
hurt to go to the database every single time ?
Thanks,
Aswin.

If we are doing a lot of single row reads does it
hurt to go to the database every single time ?Yes. The more writes you do compare to reads, and the more data you are
operating on (reads and writes) the worse the cache performs per amount of
memory used by the cache.
Peace,
Cameron Purdy
Tangosol, Inc.
Clustering Weblogic? You're either using Coherence, or you should be!
Download a Tangosol Coherence eval today at http://www.tangosol.com/
"Aswin Dinakar" <[email protected]> wrote in message
news:[email protected]..
>

Similar Messages

  • To RAID or not to RAID, that is the question

    People often ask: Should I raid my disks?
    The question is simple, unfortunately the answer is not. So here I'm going to give you another guide to help you decide when a raid array is advantageous and how to go about it. Notice that this guide also applies to SSD's, with the expection of the parts about mechanical failure.
     What is a RAID?
     RAID is the acronym for "Redundant Array of Inexpensive Disks". The concept originated at the University of Berkely in 1987 and was intended to create large storage capacity with smaller disks without the need for very expensive and reliable disks, that were very expensive at that time, often a tenfold of smaller disks. Today prices of hard disks have fallen so much that it often is more attractive to buy a single 1 TB disk than two 500 GB disks. That is the reason that today RAID is often described as "Redundant Array of Independent Disks".
    The idea behind RAID is to have a number of disks co-operate in such a way that it looks like one big disk. Note that 'Spanning' is not in any way comparable to RAID, it is just a way, like inverse partitioning, to extend the base partition to use multiple disks, without changing the method of reading and writing to that extended partition.
     Why use a RAID?
     Now with these lower disks prices today, why would a video editor consider a raid array? There are two reasons:
    1. Redundancy (or security)
    2. Performance
    Notice that it can be a combination of both reasons, it is not an 'either/or' reason.
     Does a video editor need RAID?
    No, if the above two reasons, redundancy and performance are not relevant. Yes if either or both reasons are relevant.
    Re 1. Redundancy
    Every mechanical disk will eventually fail, sometimes on the first day of use, sometimes only after several years of usage. When that happens, all data on that disk are lost and the only solution is to get a new disk and recreate the data from a backup (if you have one) or through tedious and time-consuming work. If that does not bother you and you can spare the time to recreate the data that were lost, then redundancy is not an issue for you. Keep in mind that disk failures often occur at inconvenient moments, on a weekend when the shops are closed and you can't get a replacement disk, or when you have a tight deadline.
    Re 2. Performance
    Opponents of RAID will often say that any modern disk is fast enough for video editing and they are right, but only to a certain extent. As fill rates of disks go up, performance goes down, sometimes by 50%. As the number of disk activities on the disk go up , like accessing (reading or writing) pagefile, media cache, previews, media, project file, output file, performance goes down the drain. The more tracks you have in your project, the more strain is put on your disk. 10 tracks require 10 times the bandwidth of a single track. The more applications you have open, the more your pagefile is used. This is especially apparent on systems with limited memory.
    The following chart shows how fill rates on a single disk will impact performance:
    Remember that I said previously the idea behind RAID is to have a number of disks co-operate in such a way that it looks like one big disk. That means a RAID will not fill up as fast as a single disk and not experience the same performance degradation.
    RAID basics
     Now that we have established the reasons why people may consider RAID, let's have a look at some of the basics.
    Single or Multiple? 
    There are three methods to configure a RAID array: mirroring, striping and parity check. These are called levels and levels are subdivided in single or multiple levels, depending on the method used. A single level RAID0 is striping only and a multiple level RAID15 is a combination of mirroring (1) and parity check (5). Multiple levels are designated by combining two single levels, like a multiple RAID10, which is a combination of single level RAID0 with a single level RAID1.
    Hardware or Software? 
    The difference is quite simple: hardware RAID controllers have their own processor and usually their own cache. Software RAID controllers use the CPU and the RAM on the motherboard. Hardware controllers are faster but also more expensive. For RAID levels without parity check like Raid0, Raid1 and Raid10 software controllers are quite good with a fast PC.
    The common Promise and Highpoint cards are all software controllers that (mis)use the CPU and RAM memory. Real hardware RAID controllers all use their own IOP (I/O Processor) and cache (ever wondered why these hardware controllers are expensive?).
    There are two kinds of software RAID's. One is controlled by the BIOS/drivers (like Promise/Highpoint) and the other is solely OS dependent. The first kind can be booted from, the second one can only be accessed after the OS has started. In performance terms they do not differ significantly.
    For the technically inclined: Cluster size, Block size and Chunk size
     In short: Cluster size applies to the partition and Block or Stripe size applies to the array.
    With a cluster size of 4 KB, data are distributed across the partition in 4 KB parts. Suppose you have a 10 KB file, three full clusters will be occupied: 4 KB - 4 KB - 2 KB. The remaining 2 KB is called slackspace and can not be used by other files. With a block size (stripe) of 64 KB, data are distributed across the array disks in 64 KB parts. Suppose you have a 200 KB file, the first part of 64 KB is located on disk A, the second 64 KB is located on disk B, the third 64 KB is located on disk C and the remaining 8 KB on disk D. Here there is no slackspace, because the block size is subdivided into clusters. When working with audio/video material a large block size is faster than smaller block size. Working with smaller files a smaller block size is preferred.
    Sometimes you have an option to set 'Chunk size', depending on the controller. It is the minimal size of a data request from the controller to a disk in the array and only useful when striping is used. Suppose you have a block size of 16 KB and you want to read a 1 MB file. The controller needs to read 64 times a block of 16 KB. With a chunk size of 32 KB the first two blocks will be read from the first disk, the next two blocks from the next disk, and so on. If the chunk size is 128 KB. the first 8 blocks will be read from the first disk, the next 8 block from the second disk, etcetera. Smaller chunks are advisable with smaller filer, larger chunks are better for larger (audio/video) files.
    RAID Levels
     For a full explanation of various RAID levels, look here: http://www.acnc.com/04_01_00/html
    What are the benefits of each RAID level for video editing and what are the risks and benefits of each level to help you achieve better redundancy and/or better performance? I will try to summarize them below.
    RAID0
     The Band AID of RAID. There is no redundancy! There is a risk of losing all data that is a multiplier of the number of disks in the array. A 2 disk array carries twice the risk over a single disk, a X disk array carries X times the risk of losing it all.
    A RAID0 is perfectly OK for data that you will not worry about if you lose them. Like pagefile, media cache, previews or rendered files. It may be a hassle if you have media files on it, because it requires recapturing, but not the end-of-the-world. It will be disastrous for project files.
    Performance wise a RAID0 is almost X times as fast as a single disk, X being the number of disks in the array.
    RAID1
     The RAID level for the paranoid. It gives no performance gain whatsoever. It gives you redundancy, at the cost of a disk. If you are meticulous about backups and make them all the time, RAID1 may be a better solution, because you can never forget to make a backup, you can restore instantly. Remember backups require a disk as well. This RAID1 level can only be advised for the C drive IMO if you do not have any trust in the reliability of modern-day disks. It is of no use for video editing.
    RAID3
    The RAID level for video editors. There is redundancy! There is only a small performance hit when rebuilding an array after a disk failure due to the dedicated parity disk. There is quite a perfomance gain achieveable, but the drawback is that it requires a hardware controller from Areca. You could do worse, but apart from it being the Rolls-Royce amongst the hardware controllers, it is expensive like the car.
    Performance wise it will achieve around 85% (X-1) on reads and 60% (X-1) on writes over a single disk with X being the number of disks in the array. So with a 6 disk array in RAID3, you get around 0.85x (6-1) = 425% the performance of a single disk on reads and 300% on writes.
    RAID5 & RAID6
     The RAID level for non-video applications with distributed parity. This makes for a somewhat severe hit in performance in case of a disk failure. The double parity in RAID6 makes it ideal for NAS applications.
    The performance gain is slightly lower than with a RAID3. RAID6 requires a dedicated hardware controller, RAID5 can be run on a software controller but the CPU overhead negates to a large extent the performance gain.
    RAID10
     The RAID level for paranoids in a hurry. It delivers the same redundancy as RAID 1, but since it is a multilevel RAID, combined with a RAID0, delivers twice the performance of a single disk at four times the cost, apart from the controller. The main advantage is that you can have two disk failures at the same time without losing data, but what are the chances of that happening?
    RAID30, 50 & 60
     Just striped arrays of RAID 3, 5 or 6 which doubles the speed while keeping redundancy at the same level.
    EXTRAS
     RAID level 0 is striping, RAID level 1 is mirroring and RAID levels 3, 5 & 6 are parity check methods. For parity check methods, dedicated controllers offer the possibility of defining a hot-spare disk. A hot-spare disk is an extra disk that does not belong to the array, but is instantly available to take over from a failed disk in the array. Suppose you have a 6 disk RAID3 array with a single hot-spare disk and assume one disk fails. What happens? The data on the failed disk can be reconstructed in the background, while you keep working with negligeable impact on performance, to the hot-spare. In mere minutes your system is back at the performance level you were before the disk failure. Sometime later you take out the failed drive, replace it for a new drive and define that as the new hot-spare.
    As stated earlier, dedicated hardware controllers use their own IOP and their own cache instead of using the memory on the mobo. The larger the cache on the controller, the better the performance, but the main benefits of cache memory are when handling random R+W activities. For sequential activities, like with video editing it does not pay to use more than 2 GB of cache maximum.
    REDUNDANCY(or security)
    Not using RAID entails the risk of a drive failing and losing all data. The same applies to using RAID0 (or better said AID0), only multiplied by the number of disks in the array.
    RAID1 or 10 overcomes that risk by offering a mirror, an instant backup in case of failure at high cost.
    RAID3, 5 or 6 offers protection for disk failure by reconstructing the lost data in the background (1 disk for RAID3 & 5, 2 disks for RAID6) while continuing your work. This is even enhanced by the use of hot-spares (a double assurance).
    PERFORMANCE
     RAID0 offers the best performance increase over a single disk, followed by RAID3, then RAID5 amd finally RAID6. RAID1 does not offer any performance increase.
    Hardware RAID controllers offer the best performance and the best options (like adjustable block/stripe size and hot-spares), but they are costly.
     SUMMARY
     If you only have 3 or 4 disks in total, forget about RAID. Set them up as individual disks, or the better alternative, get more disks for better redundancy and better performance. What does it cost today to buy an extra disk when compared to the downtime you have when a single disk fails?
    If you have room for at least 4 or more disks, apart from the OS disk, consider a RAID3 if you have an Areca controller, otherwise consider a RAID5.
    If you have even more disks, consider a multilevel array by striping a parity check array to form a RAID30, 50 or 60.
    If you can afford the investment get an Areca controller with battery backup module (BBM) and 2 GB of cache. Avoid as much as possible the use of software raids, especially under Windows if you can.
    RAID, if properly configured will give you added redundancy (or security) to protect you from disk failure while you can continue working and will give you increased performance.
    Look carefully at this chart to see what a properly configured RAID can do to performance and compare it to the earlier single disk chart to see the performance difference, while taking into consideration that you can have one disks (in each array) fail at the same time without data loss:
    Hope this helps in deciding whether RAID is worthwhile for you.
    WARNING: If you have a power outage without a UPS, all bets are off.
    A power outage can destroy the contents of all your disks if you don't have a proper UPS. A BBM may not be sufficient to help in that case.

    Harm,
    thanks for your comment.
    Your understanding  was absolutely right.
    Sorry my mistake its QNAP 639 PRO, populated with 5 1TB, one is empty.
    So for my understanding, in my configuration you suggest NOT to use RAID-0. Im not willing to have more drives in my workstation becouse if my projekts are finished, i archiv on QNAP or archiv on other external drive.
    My only intention is to have as much speed and as much performance as possible during developing a projekt 
    BTW QNAP i also use as media-center in combination with Sony PS3 to run the encoded files.
    For my final understanding:
    C:  i understand
    D: i understand
    E and F: does it mean, when i create a projekt on E, all my captured and project-used MPEG - files should be situated in F?  Or which media in F you mean?
    Following your suggestions in want to rebulid Harms-Best Vista64-Benchmark comp to reach maximum speed and performance. Can i use in general the those hardware components (exept so many HD drives and exept Areca raid controller ) in my drive configuration C to F. Or would you suggest some changings in my situation?

  • Query Performance Issues on a cube sized 64GB.

    Hi,
    We have a non-time based cube whose size is 64 GB . Effectively, I can't use time dimension for partitioning. The transaction table has ~ 850 million records. We have 20+ dimensions among which 2 of the dimensions have 50 million records.
    I have equally distributed the fact table records among 60 partitions. Each partition size is around 900 MB.
    The processing of the cube is not an issue as it completes in 3.5 hours. The issue is with the query performance of the cube.
    When an MDX query is submitted, unfortunately, in majority of the cases the storage engine has to scan all the partitions (as our cube  is not time dependent and we can't find a suitable dimension that will fit the bill to partition measure group based
    on it.)
    I'm aware of the cache warming and  usage based aggregation(UBO) techniques.
    However, the cube is available for users to perform adhoc queries and hence the benefits of cache warming and UBO may cease to contribute to the performance gain as there is a high probability that each user may look at the data from different perspectives
    (especially when we have 20 + dimensions) as day(s) progress.
    Also, we have 15 + average calculations (calculated measures) in the cube. So, the storage engine sends all the granular data that the formula engine might have requested (could be millions of rows) and then perform the average calculation.
    A look at the profiler suggested that considerable amount of time has been spent by storage engine to gather the records (from 60 partitions).
    FYI - Our server has RAM 32 GB and 8 cores  and it is exclusive to Analysis Services.
    I would appreciate comments from anyone who has worked on a large cube that is not time dependent and the steps they took to improve the adhoc query performance for the users.
    Thanks
    CoolP

    Hello CoolP,
    Here is a good articles regarding how to tuning query performance in SSAS, please see:
    Analysis Services Query Performance Top 10 Best Practices:
    http://technet.microsoft.com/en-us/library/cc966527.aspx
    Hope you can find some helpful clues to tuning your SSAS Server query performance. Moreover, there are two ways to improve the query response time for an increasing number of end-users:
    Adding more power to the existing server (scale up)
    Distributing the load among several small servers (scale out)
    For detail information, please see:
    http://technet.microsoft.com/en-us/library/cc966449.aspx
    Regards,
    Elvis Long
    TechNet Community Support

  • Optimizing cursor read performance

    I frequently iterate through an 8gb table with a cursor (using the C api on a btree table), and find that i/o read performance can be quite poor on my production system, with iostat showing 5mb/second read speeds.
    However, when I db_dump / db_load the table, read performance goes up significantly (60mb/second on my imac, which I develop on).
    When times, I'm able to iterate over my 8gb (1.5 million record) table in 140 seconds after dump/load. Before the dump/load, it took about 20 minutes. File size is not much reduced after the dump/load.
    My suspicion is that the production database, that has constant read/writes to it, is fragmented, and thus perhaps the data is not optimized for btree cursor scanning of the entire table.
    So... my question is...
    What should I do to maintain the highest level of read performance on a large database? Will DB->compact provide me with the same performance level that a full dump/load will?
    I could periodically down my web site do do a dump/load, but with 12gb of data, that would be a significant downtime. I'm also nervous about dump/load in a logging environment (ie, not losing any data in the log but not yet in the tables)
    Another question, that I suspect the answer is "no" to, is: is there a way to read records out of a table in written-to-disk order, so as to optimize disk drive read head performance? i.e., avoiding asking the disk drive head to move all over the table as the cursor iterates.
    -john

    db_dump (the utility itself), when executed with standard options, calls db->dump(). So what one has to look for is what __db_dump() itself is doing:
    1048         /*
    1049          * Get a cursor and step through the database, printing out each
    1050          * key/data pair.
    1051          */
    1052         if ((ret = __db_cursor(dbp, NULL, &dbcp, 0)) != 0)
    1053                 return (ret);
    1054
    1055         memset(&key, 0, sizeof(key));
    1056         memset(&data, 0, sizeof(data));
    1057         if ((ret = __os_malloc(dbenv, 1024 * 1024, &data.data)) != 0)
    1058                 goto err;
    1059         data.ulen = 1024 * 1024;
    1060         data.flags = DB_DBT_USERMEM;
    1061         is_recno = (dbp->type == DB_RECNO || dbp->type == DB_QUEUE);
    1062         keyflag = is_recno ? keyflag : 1;
    1063         if (is_recno) {
    1064                 keyret.data = &recno
    1065                 keyret.size = sizeof(recno);
    1066         }
    1067
    1068 retry: while ((ret =
    1069             __dbc_get(dbcp, &key, &data, DB_NEXT | DB_MULTIPLE_KEY)) == 0) {
    1070                 DB_MULTIPLE_INIT(pointer, &data);
    1071                 for (;;) {
    1072                         if (is_recno)
    1073                                 DB_MULTIPLE_RECNO_NEXT(pointer, &data,
    1074                                     recno, dataret.data, dataret.size);
    1075                         else
    1076                                 DB_MULTIPLE_KEY_NEXT(pointer,
    1077                                     &data, keyret.data,
    1078                                     keyret.size, dataret.data, dataret.size);As you can see, it's reading through the database and using the DB_MULTIPLE interface to retrieve multiple keys at once. Now this in itself, while performance oriented, may not explain a magnitude 10 difference in the particular pattern you're seeing. What may explain such an immediate difference is the simple fact that after having scanned through the database within your own application, you've already primed both the database cache and the OS' own filesystem cache.
    What you're experiencing is not pointing towards any kind of fragmentation but rather showing the positive benefits of caching.
    Since it would be atypical (making an educated assumption) for your application to do a full database traversal in standard use - what you're seeing with a 20 minute full traverse on cold cache is not really accurate in what your application will see anyways.
    What you should do to maintain the highest level of read performance is quite simple:
    1. Locality of reference (http://en.wikipedia.org/wiki/Locality_of_reference).
    In the context of BDB this simply means choosing the appropriate key and (if necessary) btree comparison function that will place related data near or on the same page as other related data. Almost every application has locality of reference. Even if there is an initial page location and load hit in efficiency there will most likely follow an opportunity to take advantage of LoR from that point on. Ask yourself: is your application making the most of LoR based on the data and usage patterns it has available to it?
    2. I/O costs. It may be quite possible to simply store less actual data by reducing any redundancy of data within the data itself. Is there a common trend for repetition of information between row to row? Here's a simplistic example:
    key:data (year|make|occupation|location)
    Sam:1982 Ford|Office Manager|Los Angeles
    John:1992 Honda|Mechanic|San Francisco
    Billie:1993 Honda|Pilot|Los Angeles
    Susie:1989 Dodge|Office Manager|Detroit
    Jimbo:2000 Ford|Policeman|San Francisco
    Dale:1962 Dodge|Mechanic|New YorkAlmost every "column" there can be collapsed into an atomic integer (uint8_t, uint16_t, uint32_t, etc.) type which will significantly cut down on overall costs of storing the row data itself. For instance, applied to the above data, even if we were using uint32_t for each specific column (when some could utilize uint16_t or even uint8_t), you're looking at 12-16 bytes and the cost savings increase as more repetition is present among rows beforehand - as after they will share integer ids for duplicate "columns" between rows. It's not free per se, as it will transfer costs to CPU when one has to expand the integer id back to byte string (when actually making use of the data) and it will shift I/O to another "resolution" database - albeit the majority of this I/O you would be doing anyway. However, since one is storing less data overall we will be able to take more advantage of the cache that is available to us and definitely amortize the costs of decomposition/composition of integer keys to byte strings. The actual CPU cost of calling additional functions is ridiculously small compared to waiting on I/O. If you're comfortable with the additional complexity and your data has high levels of redundancy, then you should explore the possibilities.
    In addition, another thing to explore is the possibility of database normalization (http://en.wikipedia.org/wiki/Database_normalization) for your data.
    The common theme here, along with both normalization and the previous method, is to eliminate any significant sources of redundancy. If you don't have any source of redundancy and actually have 12GB of unrelated, unique (from row to row) data, then the only thing you can do is appropriately plan the database such that you'll be exploiting LoR - and if that offers no advantage - last resort: throw more cache and disk heads at it.
    All that aside, there is a stronger question evident in your first statement:
    <i>I frequently iterate through an 8gb table with a cursor</i>
    and that question is <b>why</b>? This should <b>not</b> be necessary for a typical application to do.

  • Dynamic filed -column mapping

    Hi,
    I'm evaluating the latest Kodo JDO and am facing some problem mapping our
    existing data model.
    What we need is a dynamic field to table column mapping, i.e, I would like
    to define a Map within my class that can hold an arbitrary number of
    column names and values, and have these peristed and/read. I am not sure
    how, if at all, if I can use the custom class/field mapping to achieve
    this.
    Just to make things more clear, I'm looking for a way to implment a
    MyClass.getValue(fieldName), and MyClass.setValue(fieldName,fieldValue)
    API, where the possible set of of field names can only be known at run
    time.
    Thanks for any help!!
    Anoop

    Thank you. I understand that if I define my own classmapping , override
    the insert(), update(), delete and probably a few other functions to
    determine the SQL queries, I hould be there. I probably need to define a
    FieldMetaData too, right?
    How could I go about implementing the lazy loading, or fetch groups,
    though? As I see it, the custom class mappings only provide a way to load
    the entire data of a JDO.
    I realise this is stretching the limits of JDO, but I hope I'm right in
    assuming that once the above is in place, it would be possible to leverage
    the benefits of caching, clustering and transaction management provided by
    the JDO implementation.
    Thanks,
    Anoop
    Patrick Linskey wrote:
    You probably could put together a custom field mapping to achieve this.
    However, note that this is not a use case that Kodo is intended for.
    It is likely that it would be possible to put together a custom field
    mapping that would properly deal with queries, and maybe even one that
    could handle lazy loading.
    -Patrick
    On Wed, 04 Jun 2003 15:05:23 +0000, Anoop wrote:
    Hi,
    I'm evaluating the latest Kodo JDO and am facing some problem mapping
    our existing data model.
    What we need is a dynamic field to table column mapping, i.e, I would
    like to define a Map within my class that can hold an arbitrary number
    of column names and values, and have these peristed and/read. I am not
    sure how, if at all, if I can use the custom class/field mapping to
    achieve this.
    Just to make things more clear, I'm looking for a way to implment a
    MyClass.getValue(fieldName), and MyClass.setValue(fieldName,fieldValue)
    API, where the possible set of of field names can only be known at run
    time.
    Thanks for any help!!
    Anoop
    Patrick Linskey
    SolarMetric Inc.

  • What benefits do I lose by clearing cache?

    I've been advised to "delete Cashes.db" and "to Empty Caches" as steps in speeding up by slow Safari?  What advantages to having these do I lose by doing either or both of these;  that is, are there any important functions, such as slower speed for a while, that I lose by doing so? Thanks.

    Caches store frequently accessed data so it doesn't have to be re-loaded from the Internet or HDD both of which are slower. Deleting caches will only cause a short-term slowdown until they are re-populated automatically. Deleting a cache is only necessary if it contains old data that keeps loading in place of new data, but this is a rare occurrence.

  • Write behind cache, DB down, when should the system stop taking new data in

    Hello:
    We are trying to use Coherence for our custom ESB, which is brokering payloads of various size between consumer and provider applications.
    Before Coherence, stopping our DB meant organization-wide outage for critically important business services.
    Since we have at least 40G of RAM in production environment, we believe that our app
    can use Coherence write-behind option for tolerating at least several hours worth of DB outage.
    We are currently using a near cache backed by distributed cache in write-behind mode.
    9 business service JVMs (storage enabled=false) use 30 storage enabled JVMs.
    IMPORTANT: We need to create an automated alerting facility determining when
    amount of unsaved data reaches critical level since DB goes down. This alert should help us decide when our application stops accepting inbound traffic.
    It is hard to use QueueSize parameter for that because our payload memory footprint can vary from 1KB to 3MB.
    We do not expire any entries in order to enable support queries against the cache during DB outage.
    Our experiments with trying various flavors of overflow-scheme resulted in OutOfMemoryError, therefore
    we decided to implement RAM-only cache as a first step.
    <near-scheme>
    <scheme-name>message_payload_scheme</scheme-name>
    <front-scheme>
    <local-scheme>
    <scheme-ref>limited_entities_front_scheme</scheme-ref>
    <high-units>100</high-units>
    </local-scheme>
    </front-scheme>
    <back-scheme>
    <distributed-scheme>
    <backing-map-scheme>
    <read-write-backing-map-scheme>
    <internal-cache-scheme>
    <local-scheme>
    <scheme-ref>limited_bytes_scheme</scheme-ref>
    <high-units>199229440</high-units>
    </local-scheme>
    </internal-cache-scheme>
    <cachestore-scheme>
    <class-scheme>
    <class-name>com.comp.MessagePayloadStore</class-name>
    </class-scheme>
    </cachestore-scheme>
    <read-only>false</read-only>
    <write-delay-seconds>3</write-delay-seconds>
    <write-requeue-threshold>2147483646</write-requeue-threshold>
    </read-write-backing-map-scheme>
    </backing-map-scheme>
    <autostart>true</autostart>
    </distributed-scheme>
    </back-scheme>
    </near-scheme>
    <local-scheme>
    <scheme-name>limited_entities_front_scheme</scheme-name>
    <eviction-policy>LRU</eviction-policy>
    <unit-calculator>FIXED</unit-calculator>
    </local-scheme>
    <local-scheme>
    <scheme-name>limited_bytes_scheme</scheme-name>
    <eviction-policy>HYBRID</eviction-policy>
    <unit-calculator>BINARY</unit-calculator>
    </local-scheme>

    Good info ... I feel like I need to restate my original question along with a couple of new questions caused by the discussion above.
    Q1. Does Coherence evict 'dirty', or 'queued', or 'unsaved' objects for cache configuration provided above?
    The answer should be 'NO', otherwise Coherence is unsafe to use as a system of record,
    it should not just drop unsaved information on the floor.
    Q2. What happens to the front tier of the near+partitioned write behind cache described above when amount of unsaved data exceeds max cache capacity defined via high-units?
    I would expect that map.put starts throwing exceptions: cache storage is full, so it should not accept more data
    Q3. How can I determine a moment when amount of dirty data in bytes(!), not in objects, hits 85% of
    max allowed cache capasity configured in bytes (using high-units param and BINARY calculator).
    'DirtyUnits' counter can probably be built with some lower-level Coherence API. Can we use
    this API?
    Please, understand, that we purchased Coherence for reliability, for making our
    system independent from short DB outages, for keeping our business services up
    and running when DBA need some time for admin operations like rebuilding an index.
    Performance benefits are secondary and are not as obvious for our system which
    uses primary keys only and has a well-tuned co-located Oracle back-end.
    We simply cannot put Coherence to production unless we prove that Coherence
    can reliably hold the data and give us information about approaching crisis
    (the cache full of unsaved data).
    If possible, forward this message to Cameron Purdy,
    who was presenting Coherence to our team several moths ago.
    Thanks,
    Vasili Smaliak
    Applications Architect, Enterprise App Integration
    GMAC ResCap
    [email protected]

  • Intel Z68 Sandy Bridge chipset and SSD caching....

    For those of us considering a move to the Sandy Bridge/Z68 platform, we will eventually need to sort out whether to take advantage of the chipset's ability to "improve" ONE hard drive with a smallish (64GB or less) SSD.
    Results I have seen indicate read speeds considerably slower than an SSD drive alone but acceptably improved performance over a bare hard drive. It seems like a promising situation. Capacity of a TB hard drive with read speeds nicely bumped upwards.
    http://www.tomshardware.com/reviews/z68-express-lucidlogix-virtu-ssd-caching,2888.html
    Question: If a user followed Harm's and other's suggestions in setting up a basic 3- or 4-drive computer, which drive should take the cheapo SSD?
    Thoughts:
    1) Assume the Z68 platform is loaded with all 16GB of memory that the four-slot Socket 1155 motherboard can typically accept. Would CS5 or 5.5 load enough program data into RAM to render placing the SSD on the OS drive for editing with Premiere minimally beneficial? Or would it simply make sense to put the SSD on the OS drive for so many other reasons that it's a no-brainer?
    2) If it's a close call, which other drive should get the SSD? If I understand correctly, this hybrid drive won't write data all that much better. The improvement will primarily be on reads. And on that, random access reads, not sustained throughput. This is especially the case with cheaper 40GB-ish SSD's. (Some one please verify this.) Most Sandy Bridge users opting for the lower end, 20 PCI-e lanes platform won't be big-time power users. (You guys are waiting for the Socket 2011 platform.) Many of us will be getting our footage from DSLR or other AVCHD sources. AVCHD is so compressed that a single drive can supply more than enough layers for the Joe Blow amateur editor.
    Unless we use Cineform NeoScene to lighten the load on the CPU, which will result in a much larger bitstream coming off the media drive for each layer, Would it make sense to help out a single drive in this situation? Or would it be universally better to set up a simple 2-disk RAID 0? Paying $65 for second drive and taking advantage of motherboard RAID 0 would seem to be a better solution if the media drive can't keep up.
    For any situation, if the media drive(s) is already fast enough, would caching the media drive offer many benefits? I'm under the impression that feeding Premiere with footage is a sequential read situation, not a random access deal. Isn't the strength of an SSD in random access reads, and wouldn't the best usage be to place it on a disk that primarily is used by Premiere in random access data fetching?
    3) Good grief. If it doesn't go on the OS or primary media drive supplying footage, where else? Projects disk? Scratch drive?
    4) Might the most useful thing be to avoid setting up a RAID while getting some of the speed benefits a RAID 0 offers? Many casual users can build a straightforward computer but have never set up a RAID array, even a 2-disk RAID 0.
    40GB SSD's are under $100 now. I suspect a lot of people will use this feature of the Z68, if the hybrid drive isn't hard to set up and is reliable. I'm curious how the Premiere crowd will make use of this feature, and will it make a palpable difference on a relatively simple editing rig? No Areca RAID cards and only 16GB memory. Nothing more than 3 or 4 single drives.

    Frankly I don't see how an inexpensive SSD would help the "caching" for editing with Premiere CS5, since a typical 7200 rpm 1TB drive can perform substained writes at about 2x what a typical small SSD does.
    Premiere CS5 continues to beg for lots of drives!
    Jim
    (one of the few "believers" in SSDs on this forum - and my "belief" is for OS and programs, not for input, media, caching, etc.)

  • Caching initial contexts

    I have read the posts about caching initial context lookups and have
    implemented the solution and seen some benefits.
    I am dealing with a third party application that I cannot change.
    When I put my InitialContextFactory in the architecture I also logged
    how many getInitialContext() calls were being made - I was absolutely
    shocked - often 4+ per user transaction. I suspect that the code gets
    one, does a call and dereferences all over the place.
    90% of InitialContexts had the same environment passed to the getIC()
    call so it struck me that what I should do is create a pool of IC, and
    in my factory just serve one from the pool.
    So, the question is, what is the best way of detecting when the IC has
    been dereferenced so I know I can serve it again from my pool?
    I presume this is a generic pool problem when you can't guarantee that
    your client's will be good citizens and call a close() method or
    similar.
    I've posted here as it is performance related; also, is there any
    reason why what I am doing is not a good idea?
    Can the client do something with the IC which means it is not suitable
    for use by another client? If so, can I detect this so I may discard?
    As always, many thanks in advance.
    Presuming I can get it to work I will post the code so that we can all
    share ;-)
    Cheers
    Ed

    Why don't you instrument your factory then to give out your own
    implementation of InitialContext that will in fact only wrap a "loaner"
    InitialContext every time a method is invoked on it and before returning
    the value to the caller will put the real InitialContext back to the
    pool to be reused by another one.
    Then your clients can do whatever they want with those ICs and still
    would not cause so big performance hits.
    It's just an idea that just came to mind and I haven't tested it so it
    might have flaws but it looks viable.
    --dejan
    Ed Barrett wrote:
    The application is a third-party product that cannot be changed.
    By introducing the factory you gave below (thanks!) we put the application
    back under the load test and saw minimal improvements (like 1% response
    time).
    I then instrumented the factory with a system.out on finalize and noticed
    that a factory instance is created for each call to getInitialContext() - is
    this the way that WLS/J2EE works? I would have hoped that factories were
    shared or something. What we did see is that for one user request a number
    (sometimes 5!) ICs were being created ;-( Obviously the lookup cache is a
    class instance and shared across the lot.
    So then I started to think about pre-creating ICs and haveing a pool for the
    default ones (environment specifies URL and no security details or the
    like). Trouble is how to implement such when you cannot change the client
    code to call a factory return method (such as returnToPool()).
    Any ideas would be appreciated
    "Dimitri I. Rakitine" <[email protected]> wrote in message
    news:[email protected]...
    I've ran into this problem while porting 5.1 application (JNDI lookups
    were
    super-cheap) to 6.1 (where they are not so cheap due to
    serialization/deserialization)
    and did this test to see if this indeed was the problem. As you saw I
    didn't bother to
    cache InitialContext's - I just cached JNDI lookups and that resulted in
    very significant
    performance improvements.
    Which application are you testing it with?
    Graham <[email protected]> wrote:
    Dimitri,
    We did this but did not see that much improvement over the default way -
    we
    are using 6.1 sp2.
    We put some messages in our factory and found that the client code often
    created over 4 ICs for one user click - aaggghhhh!! As I say we cannot
    change their code but if we could take the time to create an IC away
    from
    the online response we feel we would save some time.
    We also observed a new instance of the IC factory being created every
    time a
    new IC was created - is this what you would expect?
    I think this is what NamingManager.getInitialContext() is supposed to do.
    Cheers
    Ed
    "Dimitri I. Rakitine" <[email protected]> wrote in message
    news:[email protected]...
    Caching InitialContext's will probably not quite solve the problem,
    because lookup()'s are expensive (in 6.x), so, caching lookup results
    will result in performance improvements.
    If you cannot change the 3'rd party code and all it does is:
    ... DataSource ds = (DataSource)new InitialContext().lookup(".....");
    or similar, you can add caching by implementing your own InitialContext
    factory,
    for example: (extremely simplistic)
    Startup class :
    System.setProperty("java.naming.factory.initial",
    "myjndi.InitialContextFactory");
    where
    myjndi.InitialContextFactory is :
    public class InitialContextFactory implements
    javax.naming.spi.InitialContextFactory {
    public Context getInitialContext(Hashtable env) throws
    NamingException
    Context ctx = new
    weblogic.jndi.WLInitialContextFactory().getInitialContext(env);
    return
    (Context)Proxy.newProxyInstance(ctx.getClass().getClassLoader(),
    new Class[]
    { Context.class },
    new
    ContextHandler(ctx));
    and myjndi.ContextHandler is:
    public class ContextHandler implements InvocationHandler {
    Context ctx;
    static Hashtable cache = new Hashtable();
    public ContextHandler(Context ctx) {
    this.ctx = ctx;
    public Object invoke(Object proxy, Method method, Object[] args)
    throws Throwable {
    try {
    Object retVal;
    if("lookup".equals(method.getName()) && args[0] instanceof
    String) {
    retVal = cache.get(args[0]);
    if(retVal == null) {
    retVal = method.invoke(ctx, args);
    cache.put(args[0], retVal);
    } else {
    retVal = method.invoke(ctx, args);
    return retVal;
    } catch(InvocationTargetException oops) {
    throw oops.getTargetException();
    Ed <[email protected]> wrote:
    Adarsh,
    We agree it is a brilliant idea - now just to work out how to do it.
    As you cannot always guarantee to be able to change the client code
    you cannot use normal pooling techniques:
    getObjectFromPool()
    // do work
    returnObjectToPool()
    So, the client code needs an InitialContext. We can put in our own
    Factory and intercept the getInitialContext() calls. This method
    must
    return class javax.naming.Context - therefore the only way I can see
    to spot when the class is dereferenced is to extend the class and add
    a finalize() method that notifies the factory.
    The trouble I believe is that the class cannot be "rescued" in the
    finalize() method (i.e. "I'm dying - take me back" ;-). If it simply
    told the factory to add another one to its pool this would mean that
    the new IC create "hit" would be in garbage collection (i.e. the
    users
    will pay somewhere along the line) - is this correct?
    Anyone any ideas on a solution? I have discovered out code create
    HUNDREDS of contexts in an hour and discards them very quickly. Be
    nice to be able to cache them!
    Cheers
    Ed
    "Adarsh Dattani" <[email protected]> wrote in message
    news:<[email protected]>...
    Ed,
    This a brilliant idea. We are planning something similar too. We
    first
    want to create a pool of LDAP connections as apps make extensive
    calls
    to
    LDAP. Did you check-out the object pooling api at Jakarta Commons.
    It
    deserves a close look.
    http://jakarta.apache.org/commons/pool/index.html
    Thanks,
    Adarsh
    "Ed" <[email protected]> wrote in message
    news:[email protected]...
    I have read the posts about caching initial context lookups and
    have
    implemented the solution and seen some benefits.
    I am dealing with a third party application that I cannot change.
    When I put my InitialContextFactory in the architecture I also
    logged
    how many getInitialContext() calls were being made - I was
    absolutely
    shocked - often 4+ per user transaction. I suspect that the code
    gets
    one, does a call and dereferences all over the place.
    90% of InitialContexts had the same environment passed to the
    getIC()
    call so it struck me that what I should do is create a pool of IC,
    and
    in my factory just serve one from the pool.
    So, the question is, what is the best way of detecting when the IC
    has
    been dereferenced so I know I can serve it again from my pool?
    I presume this is a generic pool problem when you can't guarantee
    that
    your client's will be good citizens and call a close() method or
    similar.
    I've posted here as it is performance related; also, is there any
    reason why what I am doing is not a good idea?
    Can the client do something with the IC which means it is not
    suitable
    for use by another client? If so, can I detect this so I may
    discard?
    As always, many thanks in advance.
    Presuming I can get it to work I will post the code so that we can
    all
    share ;-)
    Cheers
    Ed
    Dimitri
    Dimitri

  • Can a PDF prevent itself from being cached locally?

    Hi folks -
    I work for an non-profit organization that provides retirement/medical benefits. There are a number of PDF fillable forms that we would like to provide access to via our portal, forms that may require our users to enter sensitive information such as Social Security Number, etc. This isn't really a pressing concern for our users on their home computers, but we are concerned about caching of this kind of data on a borrowed machine or a public machine.
    I know that Reader local caching can be avoided via deselection of the "Use Page Cache" setting. However, we'd like to take this concern out of the equation from the start and avoid having the users themselves being required to stop the local caching. Is there any way to create a PDF that will not be eligible for local caching? Does anyone have any suggestions other than that for how we can avoid this situation?
    Thanks in advance!
    Frank

    Thanks for the reply, Michael.
    I understand what you are saying, and was aware of those aspects of PDF usage, but let me re-phrase what I am asking: if a user looks at a fillable form, fills out their info, prints the completed PDF form, and closes either Adobe Reader or their browser session that presented the PDF (more likely the latter scenario), how can we ensure that none of the information they entered remains accessible on the computer that person was using?
    Thanks -
    Frank

  • 8 core benefits?

    Hi,
    I'm looking to buy a new mac pro (hoping for an update soon) and I was wondering how much Logic 8 benefits from an 8 core mac pro as opposed to a 4 core one. Currently you have to pay quite a lot more for an 8 core, but if this means you'll really benefit from twice the processing power, this is something to think about...
    Thanks in advance.

    HI RealDave,
    The article is in the UK PC Pro mag and is a review of the Intel Core 2 Extreme QX9650 (codenamed Penryn). I've checked their site but it only seems to be in the mag at present so sorry no link.
    Here's a few quotes though:
    "Our test CPU was the top-end Quad core 2 Extreme QX9650, running at 3GHz. The clock speed has caused surprise in some quarters: it was widely believed that the new Extreme part would debut at 3.33GHz. Buss speed and preferred chipset are identical to those of the previous top end part, the Core Extreme QX6850, with a 1,333MHz front-side buss......"
    "Against the 3GHz QX6850, percentage performance improvement is never close to double figures. The extra cache and some instruction-pipeline tweaks give the QX9650 only around a 6% boost against the QX6850 in our most CPU-bound test,the 3ds Max render..."
    "the message from these first test results is that if you have a current-generation quad core CPU you won't gain much performance by upgrading...."
    ""...big performance gains will only come once the higher-clocked parts that the 45nm will allow are released"
    This is only what I read though so don't shoot the messenger!

  • Local Cache Visibility from the Cluster

    Hi, can you give me an explanation for the following Coherence issue, please ?
    I found in the documentation that the Coherence local cache is just that: a cache that is local to (completely contained within) a particular cluster node and is accessible from a single JVM.
    On te other hand, I also found the following statement:
    “ Clustered caches are accessible from multiple JVMs (any cluster node running the same cache service). The cache service provides the capability to access local caches from other cluster nodes.”
    My questions are:
    If I have local off-heap NIO memory cache or NIO File Manager cache on the one Coherence node, can it be visible from other Coherence nodes as a clustered cache  ?
    Also, if I have NIO File Manager cache on a shared disk, is it possible to configure all nodes to work with that cache ?
    Best Regards,
    Tomislav Milinovic

    Tomislav,
    I will answer your questions on top of your statements, OK?
    "Coherence local cache is just that: a cache that is local to (completely contained within) a particular cluster node and is accessible from a single JVM"
    Considering the partitioned (distributed) scheme, Coherence is a truly peer-to-peer technology in which data is spread across a cluster of nodes, the primary data is stored in a local JVM of one node, and its backup is stored in another node, preferably in another site, cluster or rack.
    "Clustered caches are accessible from multiple JVMs (any cluster node running the same cache service). The cache service provides the capability to access local caches from other cluster nodes"
    Yes, no matter if the data is stored locally in a single node of the cluster, but when you access that data through its key, Coherence automatically finds that data in the cluster and brings to you. Its transparently for the developer the location of data, but one thing is certain: you have a global view of caches, meaning that from every single member, you have access to all data stored. This is one of the magic that the Coherence protocol (called TCMP) does for you.
    "If I have local off-heap NIO memory cache or NIO File Manager cache on the one Coherence node, can it be visible from other Coherence nodes as a clustered cache  ?"
    As I said earlier, yes, you can access all the data stored from any node of the cluster. The way in which each node store its data (called as backing map scheme) can differ. One node can use an elastic data as backing map scheme, and another node can use Off-Heap NIO Memory Manager as backing map. This is just the way about each node store its data. For the architectural point of view, its a nice choice to use the same backing map scheme across multiple nodes, because each backing map scheme can have different behaviors when you read and/or write data. One could be faster and another could be slower.
    "Also, if I have NIO File Manager cache on a shared disk, is it possible to configure all nodes to work with that cache ?"
    There is no need for that, since data is available to all cluster nodes without any effort. Having said that, this would be a bad strategy choice. Coherence is a shared-nothing technology which uses that model to scale and give you predictable latency. If you start using a shared-disk as storage for data, you will lose the essence of shared-nothing benefits, and create a huge bottleneck in the data mgmt layer, since will occur dispute per I/O in each read/write.
    Cheers,
    Ricardo Ferreira

  • Prepared statement cache & Oracle

    Hi -
    Does Weblogic's prepared statement caching only work when using their
    type-2 Oracle driver? Are there any documents about using this
    Weblogic feature? I have only found small references in the Weblogic
    documentation so far -- nothing with much detail.
    Thanks for any help,
    - Mark

    "Joseph Weinstein" <[email protected]> wrote in message
    news:[email protected]..
    >
    >
    Mark Cassidy wrote:
    Hi -
    Does Weblogic's prepared statement caching only work when using their
    type-2 Oracle driver?No. It is generic to JDBC. Any JDBC driver should allow re-use ofPreparedStatements,
    and our pool will cache for any driver.
    Are there any documents about using this
    Weblogic feature? I have only found small references in the Weblogic
    documentation so far -- nothing with much detail.You are correct that there is too little documentation at this time.
    Thanks for any help,
    - Mark
    Thanks Joe!
    Do you know if each connection's cache is FIFO? Or do you use
    least-recently-used algorithm?
    I found one comment you made regarding XA pools. That means that if we are
    doing 2-phase commit processing that some of these benefits could erode? I
    didn't understand why. If we assume that the connections in a given pool
    after a time get a good sampling of popular prepared statements, would their
    being XA or not matter? Maybe I missed your point entirely.
    - Mark

  • Impact of real time cube on query performance and OLAP cache

    Hi:
    We have actual and plan cubes both setup as real time cubes (only plan cube is being planned against, not actual cube) and both cubes are compressed once a day.
    We are planning on implementing BIA accelerator and have questions related to query performance optimization:
    1/ Is there are any query performance benefits in changing the actual cube to be a basic cube (using program SAP_CONVERT_NORMAL_TRANS) if the F table is fully compressed
    2/ Can OLAP cache be leveraged for the queries run against the real time cubes e.g. actual cubes
    3/ What is the impact on BIA of having the actual cube as real time (whetehr or not there is data being loaded/planned during the day in that cube)
    Thank you in advance,
    Catherine

    1) Is there are any query performance benefits in changing the actual cube to be a basic cube (using program SAP_CONVERT_NORMAL_TRANS) if the F table is fully compressed
    From the performance point of view, tha actual cubes i.e std cubes are relatively better.
    2) Yes OLAP cache can be leveraged for bringing up the plan query but all the calculations are done in the planning buffer.
    3) Not sure.

  • Possible result cache problem 11GR1;;Plz Help me :)

    Hello,
    I just finished installing Oracle 11g Enterprise Edition on my laptop,under windows XP 32 Bit,
    Just run to test the result cache ,It seems the result cache does not work for me ;
    Please see the demonstration below and help me to undertsand:
    (I am the only person connected to the database and I only have one session conneted )
    Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
    Connected as SYS
    SQL> set timi on
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE     11.1.0.6.0     Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    Executed in 0.031 seconds
    SQL> ----result cache demonstration
    SQL> ----clear the server result cache
    SQL> exec dbms_result_cache.Flush
    PL/SQL procedure successfully completed
    Executed in 0 seconds
    SQL> ---run a query to load the server result cache
    SQL>
    SQL> SELECT /*+ result_cache */
      2   H.DEPARTMENT_ID, H.DEPARTMENT_NAME, H.MANAGER_ID, COUNT(*)
      3    FROM HR.DEPARTMENTS H
      4   GROUP BY H.DEPARTMENT_ID, H.DEPARTMENT_NAME, H.MANAGER_ID
      5  ;
    DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID   COUNT(*)
               10 Administration                        200          1
               30 Purchasing                            114          1
               50 Shipping                              121          1
               60 IT                                    103          1
               70 Public Relations                      204          1
              200 Operations                                         1
              210 IT Support                                         1
              230 IT Helpdesk                                        1
               90 Executive                             100          1
              100 Finance                               108          1
              140 Control And Credit                                 1
              150 Shareholder Services                               1
              160 Benefits                                           1
              220 NOC                                                1
              250 Retail Sales                                       1
              130 Corporate Tax                                      1
              110 Accounting                            205          1
              270 Payroll                                            1
               40 Human Resources                       203          1
              170 Manufacturing                                      1
    DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID   COUNT(*)
              260 Recruiting                                         1
               20 Marketing                             201          1
              120 Treasury                                           1
               80 Sales                                 145          1
              180 Construction                                       1
              190 Contracting                                        1
              240 Government Sales                                   1
    27 rows selected
    Executed in 0.282 seconds
    SQL> --*-response time is 0.282 seconds*
    SQL> ---Show the result information from v$result_cache_objects : is the result cache is valid ?
    SQL> --- The space used also?
    SQL>
    SQL> SELECT ID,
      2         NAME,
      3         TYPE,
      4         STATUS,
      5         BLOCK_COUNT,
      6         ROW_COUNT * ROW_SIZE_AVG AS SPACE_FOR_ROWS,
      7         SPACE_OVERHEAD
      8    FROM V$RESULT_CACHE_OBJECTS V
      9  ;
            ID NAME                                                                             TYPE       STATUS    BLOCK_COUNT SPACE_FOR_ROWS SPACE_OVERHEAD
             0 HR.DEPARTMENTS                                                                   Dependency Published           1              0              0
             1 SELECT /*+ result_cache */                                                       Result     Published           1            675            320
                H.DEPARTMENT_ID, H.DEPARTMENT_NAME, H.MANAGER_ID, COUNT(*)                                                                     
                 FROM HR.DEPARTMENTS H                                                                                                         
                GROUP BY H.DEPAR                                                                                                               
    Executed in 0.141 seconds
    SQL> ---we run again our query
    SQL>
    SQL> SELECT /*+ result_cache */
      2   H.DEPARTMENT_ID, H.DEPARTMENT_NAME, H.MANAGER_ID, COUNT(*)
      3    FROM HR.DEPARTMENTS H
      4   GROUP BY H.DEPARTMENT_ID, H.DEPARTMENT_NAME, H.MANAGER_ID
      5  ;
    DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID   COUNT(*)
               10 Administration                        200          1
               30 Purchasing                            114          1
               50 Shipping                              121          1
               60 IT                                    103          1
               70 Public Relations                      204          1
              200 Operations                                         1
              210 IT Support                                         1
              230 IT Helpdesk                                        1
               90 Executive                             100          1
              100 Finance                               108          1
              140 Control And Credit                                 1
              150 Shareholder Services                               1
              160 Benefits                                           1
              220 NOC                                                1
              250 Retail Sales                                       1
              130 Corporate Tax                                      1
              110 Accounting                            205          1
              270 Payroll                                            1
               40 Human Resources                       203          1
              170 Manufacturing                                      1
    DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID   COUNT(*)
              260 Recruiting                                         1
               20 Marketing                             201          1
              120 Treasury                                           1
               80 Sales                                 145          1
              180 Construction                                       1
              190 Contracting                                        1
              240 Government Sales                                   1
    27 rows selected
    *Executed in 0.297 seconds*
    SQL> Why the first is faster than the second?
    thanks a lot,
    Edited by: Ora-Wiss on Apr 3, 2010 2:17 PM

    I have been using 11g from quite some time now in my sessions and already have started sessions over 11gr2 as well and I can't recall that I ever faced this thing. And I just did show the same to you on my personal system as well. But nevermind, here is one more run with the database being restarted and the same code being run.
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    Elapsed: 00:00:00.00
    SQL> startup force
    ORACLE instance started.
    Total System Global Area  171573248 bytes
    Fixed Size                  1331936 bytes
    Variable Size             125832480 bytes
    Database Buffers           37748736 bytes
    Redo Buffers                6660096 bytes
    Database mounted.
    Database opened.
    SQL> exec dbms_result_cache.Flush;
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.06
    SQL> SELECT /*+ result_cache */   H.DEPARTMENT_ID, H.DEPARTMENT_NAME, H.MANAGER_ID, COUNT(*)  FROM HR.DEPARTMENTS H GROUP BY H.DEP
    ARTMENT_ID, H.DEPARTMENT_NAME, H.MANAGER_ID;
    DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID   COUNT(*)
               10 Administration                        200          1
               30 Purchasing                            114          1
               50 Shipping                              121          1
               60 IT                                    103          1
               70 Public Relations                      204          1
              200 Operations                                         1
              210 IT Support                                         1
              230 IT Helpdesk                                        1
               90 Executive                             100          1
              100 Finance                               108          1
              140 Control And Credit                                 1
    DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID   COUNT(*)
              150 Shareholder Services                               1
              160 Benefits                                           1
              220 NOC                                                1
              250 Retail Sales                                       1
              130 Corporate Tax                                      1
              110 Accounting                            205          1
              270 Payroll                                            1
               40 Human Resources                       203          1
              170 Manufacturing                                      1
              260 Recruiting                                         1
               20 Marketing                             201          1
    DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID   COUNT(*)
              120 Treasury                                           1
               80 Sales                                 145          1
              180 Construction                                       1
              190 Contracting                                        1
              240 Government Sales                                   1
    27 rows selected.
    Elapsed: 00:00:00.15
    SQL> SELECT /*+ result_cache */   H.DEPARTMENT_ID, H.DEPARTMENT_NAME, H.MANAGER_ID, COUNT(*)  FROM HR.DEPARTMENTS H GROUP BY H.DEP
    ARTMENT_ID, H.DEPARTMENT_NAME, H.MANAGER_ID;
    DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID   COUNT(*)
               10 Administration                        200          1
               30 Purchasing                            114          1
               50 Shipping                              121          1
               60 IT                                    103          1
               70 Public Relations                      204          1
              200 Operations                                         1
              210 IT Support                                         1
              230 IT Helpdesk                                        1
               90 Executive                             100          1
              100 Finance                               108          1
              140 Control And Credit                                 1
    DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID   COUNT(*)
              150 Shareholder Services                               1
              160 Benefits                                           1
              220 NOC                                                1
              250 Retail Sales                                       1
              130 Corporate Tax                                      1
              110 Accounting                            205          1
              270 Payroll                                            1
               40 Human Resources                       203          1
              170 Manufacturing                                      1
              260 Recruiting                                         1
               20 Marketing                             201          1
    DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID   COUNT(*)
              120 Treasury                                           1
               80 Sales                                 145          1
              180 Construction                                       1
              190 Contracting                                        1
              240 Government Sales                                   1
    27 rows selected.
    Elapsed: 00:00:00.01
    SQL>As you can see, I can't reproduce.
    HTH
    Aman....

Maybe you are looking for