126 reputation
5
bio website
location
age
visits member for 6 months
seen Mar 16 at 18:48
stats profile views 1

Mar
12
reviewed Approve suggested edit on Performing SELECT on EACH ROW in CTE or Nested QUERY?
Mar
12
asked Performing SELECT on EACH ROW in CTE or Nested QUERY?
Feb
20
awarded  Commentator
Feb
20
comment Storing logs on per day basis in PostgreSQL
@dezso, Could you please post your ideas as an answer ? I'm desperately looking for a proper way to do this.
Feb
19
comment Storing logs on per day basis in PostgreSQL
@dezso we dont actually sells anything, It was an example scenario that just happens to match with ours. anyway, there can be a couple thousand insertions in a day if I talk about the real problem. same can be said for reading records, a couple thousand Select per day.
Feb
18
revised Storing logs on per day basis in PostgreSQL
Added results from main edit
Feb
18
awarded  Editor
Feb
18
comment Storing logs on per day basis in PostgreSQL
@dezso I just have update the question if you want to take a look
Feb
18
comment Storing logs on per day basis in PostgreSQL
@vyegorov I have updated the question with a little more research work.
Feb
18
revised Storing logs on per day basis in PostgreSQL
Added more details
Feb
18
comment Storing logs on per day basis in PostgreSQL
There are several cases of failure in this approach, first and foremost, The days with no sales will be skipped from being recorded. secondly, we cant assure that the records wont change anymore after the data has been exported from live-records table to old-records table.
Feb
18
comment Storing logs on per day basis in PostgreSQL
@vyegorov Purpose of this design is to keep track of sales for administrator and salesman to view whenever they want it, you can say that the historical records will be accessed as frequently (or more) as live records.
Feb
17
asked Storing logs on per day basis in PostgreSQL
Feb
13
comment Loop through Self JOIN on table until the operand column is NULL completely
@Webdevilopers, do you want the solution or the example ? If solution then I settled with adjacency list model, read more about that over wikipedia en.wikipedia.org/wiki/Adjacency_list_model.
Feb
11
awarded  Supporter
Oct
30
comment Loop through Self JOIN on table until the operand column is NULL completely
Alright, another couple hours I spent on this concluded that I have to find a way to calculate the depth of the tree in order to retrieve the full tree under a given node. I came up with an approach to loop through the JOINs and select the last level result from the latest JOIN result, if the result is NULL then we have the depth of tree. I dont want to loop the query because increasing the depth level will result in so many loop iterations. Can you please suggest a way to eliminate the loop situation ? I can post the algorithm for that if you want me to.I have word limit on comments here.
Oct
30
comment Loop through Self JOIN on table until the operand column is NULL completely
Thank you for help, This is really too much now but look at this, I am stuck at calculating the depth for a particular user. There is only one restrictions on the hierarchy, User under your down-line will have ID greater than yours. So, That makes it really hard to pick an ID,say 8,and then go from ID 8 to the leaf node that is at maximum distance and then calculate the depth. Since there will be many leaf nodes it is even harder to calculate the depth by comparing the node path from root node to all of them.So all in all,I am still at the same point where I was right before testing this out.
Oct
29
comment Loop through Self JOIN on table until the operand column is NULL completely
Thanks for your efforts, This looks promising except I cannot convert it into MySQL Query without compromising on performance, Or am I missing something ? I need a query for MySQL.
Oct
29
awarded  Student
Oct
28
awarded  Custodian