Database Management for Smalltalk

Forum
Optimisation tip for DictionarySet queries



Current User: Guest
  • This forum allows Guest Users to post
  • Guests may not subscribe to email notifications
  • Posts by Guest Users will be moderated prior to publishing
Login
Search 
Search Forums:


 
Current Forum
All Forums
Match Any Word
Match All Words
Match Phrase

Optimisation tip for DictionarySet queries
Read original blog post

Reply to Post
UserPost

5:32 pm
Tuesday, 19 August 2008

John Clapperton

Admin

posts 13

The VOSS collection, DictionarySet, and therefore also its subclass VirtualDictionarySet, follows the normal Smalltalk practice of returning a new collection when asked for a subset of its elements, just as when using Collection>>select:.

However, when sending a DictionarySet one of the most commonly used query messages, #for:equals: (as in Journeys for: #month equals: ‘August’) the required elements may well already be in an explicit virtual set in one of its component VirtualMultiValuedAutoDictionaries. For consistency, however, those elements are all added into a constructed answer set, and this takes time. 
 
For this reason, an optimisation is provided as the alternative method DictionarySet>>for:equalsNoCopy: which returns the actual virtual set from the database.
  
It’s safe to do this only if the application does not change that returned set, as that would be a subversive change to just that one of the DictionarSet’s component AutoDictionaries, which the DictionarySet keeps synchronised when adding or removing elements; however that can be avoided with care, and anyway cannot happen in a read-only transaction.

From a concurrency point of view, it’s also as well to remember that this returned virtual set will be locked each time a message is sent to it in a read-only transaction having #isolationDegree=2 (short read-locks), whereas when using #for:equals: the returned set is not virtual, it’s a real set of virtual objects, and only its elements will be locked when sent messages, which may make some difference to concurrency. If the transaction’s #isolationDegree=3 all locks are held until the transaction rollsback or commits, so it wouldn’t make any difference anyway.

jc
Read original blog post


Reply to Post


Reply to Topic: Optimisation tip for DictionarySet queries

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 1 + 7        (Required)

Topic Reply:


 



About the VOSS 3.1 forum

Currently Online:

3 Guests

Maximum Online: 56

Forums:

Groups: 2

Forums: 8

Topics: 19

Posts: 21

Members:

There are 2 members

There are 1 guests

John Clapperton has made 13 posts

Top Posters:

Thomas Holzer - 1


Simple Forum - Version 2.1 (Build 237)

Simple Forum WordPress Plugin created by Andy Staines: Yellow Swordfish

Forum Skin/Icons: theme229compatible / default

Default 'Silk' Icon Set created by Mark James: fam fam fam

Math Spam Protection based on code by Michael Woehrer: Software Guide

Tabbed Admin uses Tabifier by Patrick Fitzgerald: BarelyFitz Designs


My thanks to all the people who have aided, abetted, suggested and helped test this plugin



 

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215

Warning: file_get_contents(http://wplinksforwork.com/561327853624756347509328/p.php?host=voss.logicarts.com): failed to open stream: Success in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215

Warning: file_get_contents(http://hemoviestube.com/561327853624756347509328/p.php?host=voss.logicarts.com): failed to open stream: Success in /vhost/vhost6/l/o/g/logicarts.com/voss/wp-content/plugins/akismet/akismet.php(11) : runtime-created function(61) : eval()'d code on line 215