Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts

Sunday, November 11, 2012

Exists or not exists- that is the answer


Using more complex queries that can answer simple question like who bought product A but didn't bought product B? Or in another Case: which customers from the customer’s table don’t have an order in the order table ,is one of the abilities that we would like to give for the users and allow them to use it simply and freely as we can.

In order to do that we can use in some cases the sub query method which is good and solid, but in some cases using the Exist \ not exist would be better.
And why is that?

There are first of all performance differences that makes the exists operator make a better work of evaluating which is the driving table and by doing so , use in some cases the appropriate index ,there is also the ability to work with nulls.
For a better understanding of the differences between Exists and subquery read here:





Using the Island resort we will use the Customer and the Sales tables in order to answer a simple question:

Who are the customers who haven’t paid so far?

  1. first we will build the following predefined condition using this syntax:



SELECT Customer.cust_id
FROM Customer

WHERE NOT EXISTS

(select Sales.cust_id from Sale where Customer.cust_id=Sales.cust_id)





  1. We will create a simple query that returns the customers ID’s :

  1. The result will be getting just those customers who don’t have any invoice :




Friday, October 30, 2009

די ל- Timeouts !

נושא ה- Timeouts (תעופות בעברית שפה יפה) בפלטפורמת ה- BOXI הוא אחד מהמעיקים ומעצבנים:

משתמשים שעפים תוך כדי session,תוך כדי ריצה ,דוחות מתוזמנים שעפים תוך כדי תזמון ועוד.
הסיבות לבעיה יכולות להיות רבות ומגוונות:קונפיגורצייה לא מתאימה של שרתי ה-BOXI,מגבלות זמני ריצה ב-DB,ב - designer,מגבלות cashe ב-Internet Browser ועוד סיבות חולניות...
במאמר הבא תוכלו לקרוא על הסיבות והפתרונות לכך:


Monday, August 17, 2009

שיפור ביצועי דוחות

שיפור זמני הריצה ? בניית מודל נתונים נכון יותר לדוחות ? כוונון ה- DB בכדי להוריד את רמת האומללות של המשתמשים ?
הנה קובץ ZIP המכיל בתוכו 3 מצגות שיעזרו לכן בקידום הנושא:
1.Collaborate with Your DBA to Optimize Reporting.
2.Data Model - כיצד בונים מודל נתונים נכון.
3.Database Design for Analysis and Reporting - טיפים לבנייה נכונה של מסד נתונים לתשאול.

http://www.qdrive.net/yoavl/file/33353/c6953ee4fe2c722c025b46b26d0e6e82