OCLps Example
No edit summary
No edit summary
Line 15: Line 15:


=== Watch the Video to Learn More ===
=== Watch the Video to Learn More ===
<html>
<br>
<div class="video">
  <div class="video__wrapper">
    <iframe src="https://www.youtube.com/embed/nkPR9P4i3P0" title="YouTube video player" frameborder="0" allowfullscreen></iframe>
  </div>
</div>
</html>

Revision as of 07:00, 3 March 2023

There are different approaches to improving the performance of a comment section in an article. These include selecting the article based on the self and the first comment, using the PSEval value to calculate the number of comments that are liked, and combining OCLPS and PSEval with OCL. Each approach has a different impact on performance.

One of these methods is through the use of PSEval values. PSEval provides a way to select and manipulate data in the database without loading it into memory. We will explore how to use PSEval to improve the database storage performance.

To illustrate how PSEval works, let's consider a small model that involves three tables: Article, SysUser, and Comment.

OCLps Example Image.png

A link role name allows for navigation from SysUser to Comment and vice versa. This model assumes that a SysUser won't have excessive comments.

Suppose we want to display the number of likes that an article has received. One way to do this is to load every comment object into memory, filter out the ones that have a "like", and then count how many there are. However, this would be inefficient for articles with numerous comments. A better way is to use PSEval to select only the comments that have a "like" and count them without loading them into memory.

However, using PSEval has its limitations. If a user likes or unlikes a comment, the like count in the user interface will not update because nothing is triggering a re-evaluation of the data. One way to work around this is to use PSEval to get all the comments for an article but only the ones that have a "like" on them. This method still loads objects but it only loads the ones with a "like" which can improve performance. PSEval can make querying large datasets much faster and more efficient.

Watch the Video to Learn More


This page was edited 67 days ago on 03/12/2024. What links here