SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: fun with verity

  1. #1
    SitePoint Addict -TheDarkEye-'s Avatar
    Join Date
    Mar 2001
    Location
    canada
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fun with verity

    i would like to use verity for doing a db search. the problem is data in the table is constantly (i expect) being inserted/updated and reindexing the table for every search seems like a realy bad idea to me. well, indexing the whole table does anyway: it takes too long and i would imagine, eats up a lot of server resources too.

    my idea is to keep a few timestamps in application variables as refrences to the last insert/update opperation. then i can easily select only the rows from the table that need to be indexed. also, i thought it migh be a good idea to set up a scheduled task to run every couple days, which optimizes the collection.

    what do you all think about this? anyone have any suggestions or maby a better way to do this? i dont have very much experience with verity so i duno if im doing something dumb.

  2. #2
    SitePoint Guru nagrom's Avatar
    Join Date
    Jul 2001
    Location
    Western CT, USA
    Posts
    803
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    interesting idea. i've got one that takes a good 10-15 seconds to update, and it's on a shared, virtual server, so i always feel a little guilty running that template.

    i usually do it in the wee hours of the morn. but i dont like that either, because if it screws up, it ruins my bedtime

    the application scope may not be safe for storage though, as an application can timeout on you. you might setup another column, or whole other table, that simply flags what records need to be reindexed, but then you'd need to dynamically reset them all at the end, which itself creates overhead.

    another way would be to use cffile to write the keys to a textfile, and then clear it out after the verity template runs.

    they all have overhead though. you'll have to balance it out and see what makes the most sense.

    how long is the update taking? i'm pretty sure the server wont give up too many resources for it, and that may be why it takes so long -- so it may not actually be that bad to just run the whole update.

  3. #3
    SitePoint Addict -TheDarkEye-'s Avatar
    Join Date
    Mar 2001
    Location
    canada
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the application scope may not be safe for storage though, as an application can timeout on you. you might setup another column, or whole other table, that simply flags what records need to be reindexed, but then you'd need to dynamically reset them all at the end, which itself creates overhead.
    yeah i just realized that... ill think about it for a while but i think im gona have to store the timestamps in another db table. i only need two timestamps to make this work, btw.

    how long is the update taking? i'm pretty sure the server wont give up too many resources for it, and that may be why it takes so long -- so it may not actually be that bad to just run the whole update.
    i cant give you any meaningfull numbers because my test table only has 61 rows.

    i dont want to do that because the db table could get realy big and i dont want my users to be able to run any scripts that take more than a few seconds to execute. also, i think it is just bad programming practice to grab 50,000 rows to update a collection when 49,900 of those rows have already been indexed. know what i mean?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •