Reuven

About me: Amateur web developer - Professional volunteer :)

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • Reuven replied on the discussion topic Paging of frequently changing data on Elgg 2.3.16
    Thank you iionly, you are right. We display the latest (i.e. sort DESC), log the time of the last one and the next page will start from that time downward. Of course, we miss those records that was changed in between, but we do not... view reply
  • Reuven replied on the discussion topic Paging of frequently changing data on Elgg 2.3.16
    Thank you iionly. I'll check the use of cache. However, in this specific case the underlying data can change many times per second (depending on the number of users). Therefore, the standard approach of paging may not work here. In... view reply
  • Reuven added a new discussion topic Paging of frequently changing data on Elgg 2.3.16 in the group Plugin Development
    Paging of dynamically changing data is a known topic, e.g. 1, 2. elgg_list_entities() has a pagination feature but, as I can see, without a solution for dynamically changing data. How to solve it on Elgg 2.3.16 ? Thank you
    • Thank you iionly.

      I'll check the use of cache.

      However, in this specific case the underlying data can change many times per second (depending on the number of users). Therefore, the standard approach of paging may not work here. In addition, the queries depend on many variables, including free text search. That is, there are virtually endless possibilities. Therefore, Therefore, I think the use of cache will actually be impossible.

      On this page there is a suggestion for a solution based on update time ... interesting.

    • I can't really help you with the decision here as I have no idea what kind of data you want to display.

      If this data is changing so frequently, does it even make sense to display it? Does it make sense to display all of it or wouid it enough to display the "latest" X entries - as they are "latest" at the time of request.

    • Thank you iionly, you are right.

      We display the latest (i.e. sort DESC), log the time of the last one and the next page will start from that time downward. Of course, we miss those records that was changed in between, but we do not have records that may appear twice or more.

  • Reuven replied on the discussion topic Slow response ofdatabase Elgg 2.3.16
    Thank you Jerome view reply
  • Reuven replied on the discussion topic Slow response ofdatabase Elgg 2.3.16
    Simple experiment – Excellent results Disclaimer: May upset Relational DB experts :) In our case we have 13 filters, each is based on one metadata. For each filter we need 2 Joins (for the metadata and metastring tables) and Wheres with... view reply
  • Reuven replied on the discussion topic Slow response ofdatabase Elgg 2.3.16
    Thank you Nikolai Very useful view reply
  • Reuven added a new discussion topic Slow response ofdatabase Elgg 2.3.16 in the group Plugin Development
    I'm working on a boosting feature which shows the boosted items (for fee) on the first page of 'All' or 'River'. Item's owner can characterize the users who will see the boosted item, e.g. gender, age-range, location,...
    • Simple experiment – Excellent results

      Disclaimer: May upset Relational DB experts :)

      In our case we have 13 filters, each is based on one metadata. For each filter we need 2 Joins (for the metadata and metastring tables) and Wheres with 2 sections (for the metadata name.id and the value). All together 26 Joins and 26 wheres., some of them are quite heavy like calculation the distance between two geographical point on the globe.

      However, the page is very slow with 7 filters, and dead with 10 or more.

      So, we did a simple experiment. We added a table to the Elgg database with foreign key e.guid and duplicated the relevant metadatas as columns in the new table. The query is composed of one Join (with elgg_entities) and 13 Wheres.

      Now the page loads in about a second.

      Of course, this is not the best practice but it may be a solution.

      We would appreciate any reflection on this experiment.

      Is it safe?

      Are there other alternatives?

      Do future versions of Elgg have solutions to such problem?

      Thank you.

    • In Elgg 3 the normalization of the metadata/metastring table was removed. This will help in speeding up those kind of queries.

      Time to update ;)

  • Reuven replied on the discussion topic Prevent deletion of an object
    We can put the owner and container in in metadata view reply
  • Reuven replied on the discussion topic Prevent deletion of an object
    Thank you iionly. From your answer I understand Jerome's comment about the Garbage collection plugin. The prevent deletion hook can create orphans which may be deleted by the garbage collection. So, this approach is not... view reply
  • Reuven replied on the discussion topic Prevent deletion of an object
    Thank you Jerome. making the objects owned/contained by the Site. The site is never removed. Yes, I also thought about this solution. It is simpler.  Keep in mind that maybe the Garbage collection plugin can still remove the... view reply
  • Reuven replied on the discussion topic Prevent deletion of an object
    Very good. Thank you Nikolai view reply
  • Reuven replied on the discussion topic Prevent deletion of an object
    Interesting approach. I'll try it. BTW I forgot to mention that I use Elgg 2.3.16. But it has similar hook. Thank you very much Nikolai. view reply
  • Reuven replied on the discussion topic Prevent deletion of an object
    Interesting approach. I'll try it. BTW I forgot to mention that I use Elgg 2.3.16. But it has similar hook. Thank you very much Nikolai. view reply
  • Reuven added a new discussion topic Prevent deletion of an object in the group Plugin Development
    As far as I know when an owner of an object is deleted the object is deleted as well. Same for the container of the object. However, we have a payment object that due to accounting requirements must not be deleted even if the payer or the container...
    • Or creating a user just for the purpose of transferring all content formerly owned by accounts to be deleted to. Maybe easier to handle it this way if the content is supposed to be accessible on site as some plugins might rather expect the owner being of type user and not site.

      As for the garbage collection: the plugin searches the database for orphaned data (I think maybe mostly metadata/metastrings). If these database entries have an owner_id pointing to an entity no longer existing it gets removed. That's a rather short explanation (that might even in parts be wrong as I've not looked into the code to see what exactly is done). Anyway, the hook might not help to prevent deletion because the garbage collection would rather use raw MySQL code instead of making use of Elgg API functions (that would call the hooks).

    • Thank you iionly.

      From your answer I understand Jerome's comment about the Garbage collection plugin. The prevent deletion hook can create orphans which may be deleted by the garbage collection. So, this approach is not recommended.

       Or creating a user just for the purpose of transferring all content formerly owned by accounts to be deleted to. Maybe easier to handle it this way if the content is supposed to be accessible on site as some plugins might rather expect the owner being of type user and not site.

      I do not understand this comment. Could you please explain it?

      Do you think that making the objects owned/contained by the Site is not advisable?

      Thank you very much.

       

    • We can put the owner and container in in metadata

  • Reuven replied on the discussion topic similar elgg_get_metastring_map() for subtypes
    Thank you Jeroen view reply
  • Reuven replied on the discussion topic similar elgg_get_metastring_map() for subtypes
    Thank you Jerome. PS: please try updating to Elgg 3.3 then you don't have to worry about subtype id's and metastring id's As one member responded lately to your suggestion "I'm afraid". I have many plugins... view reply
  • Reuven added a new discussion topic similar elgg_get_metastring_map() for subtypes in the group Plugin Development
    Elgg 2.3.16 I wonder if there are similar functions to elgg_get_metastring_id() and elgg_get_metastring_map(), but for subtypes. Thank you
    • Thank you Jerome.

      PS: please try updating to Elgg 3.3 then you don't have to worry about subtype id's and metastring id's

      As one member responded lately to your suggestion "I'm afraid". I have many plugins and many features. It will take me long time to update. I cannot do it right now, but I heard from you that Elgg 4 is coming soon. So, hopefully I'll go directly to Egg 4. 

      Is it possible to go from 2.3 to 4 ?

       

    • @reuven you will need to upgrade to 3.3 first (at least for Elgg) and then go to 4.x. This can be done on the same day, but you need to do both steps.

  • Reuven added a new discussion topic Google Cloud in the group General Discussion
    Our non-profit has a nice discount on Google Cloud ($300/month). I'd like to use it for Elgg 2.3.14. However, they have millions of options that I "cannot see the forest for the trees", especially for a non-professional...
  • Reuven replied on the discussion topic Change icon avatar size
    Thank you Jeroen This mischievous hook on Elgg 2.3 works well --> elgg_register_plugin_hook_handler('entity:icon:sizes', 'object', 'set_custom_icon_sizes')  :) view reply
  • Reuven added a new discussion topic Change icon avatar size in the group Plugin Development
    Elgg 2.3.14 I need to change the avatar size of an object but keep it square. I googled but did not find a solution. Any guidance will be appreciated. Thanks a lot