objectscript / LightPivotTable

Lightweight pivot table representation for MDX2JSON source for InterSystems Cache
MIT License
3 stars 4 forks source link

Crash by timeout when loading a filtered large table #17

Open AsyaSokolova opened 4 years ago

AsyaSokolova commented 4 years ago

Precondition:

nikitaeverywhere commented 4 years ago

Hello!

Thanks for providing details. It would be also very useful if you provide mode info on what kind of "timeout" you get. Is it an HTTP timeout? Javascript error (what does it say then)?

Also,

When trying to drill through a cell that contains only 2 values according to filters, the request falls by timeout.

What does it mean that the cell contains 2 values?

Thank you!

AsyaSokolova commented 4 years ago

Good afternoon, timeout for http request in the system is 60 seconds. In the main pivot table, the cell, where drillthrough occurs, contains 2 records. This is indicated for example - to show, that it will take milliseconds to execute a correct MDX query to drillthrough on this cell.

nikitaeverywhere commented 4 years ago

Asya, excuse me, I tried my best in understanding what is wrong from your description but 🤯

Suppose I am a man who didn't work on this project for a couple of years. Now I start reading:

There is a PivotTable for 68,000 entries

Okay.

This table is used as a drillthrough for another pivot table

Good, that is the thing I still remember! In DeepSeeWeb (DSW) we had such functionality when you click, the whole dashboard is updated. Looks like that's it.

During drillthrough filters are passed to the pivot table input

Filters are passed to... Wait, are you a DeepSeeWeb developer or a customer? As far as I remember filters are passed by DSW to the table. Okay... Let me read what we have below.

When trying to drill through a cell that contains only 2 values according to filters, the request falls by timeout.

How can the cell contain two values? Maybe you mean by drilling through it should give only 2 rows of data?

It was found that drillthrough first generates a get query that covers all the pivot table entries and returns html with results that do not match the filters – first 100 row from full table (A similar mdx query via the analyzer returns 2 entries correctly)

I don't remember any get queries that return HTML (but JSON). Hm. But I guess here drillthrough filters were not correctly applied?

For testing, the number of entries in this pivot table was reduced. The request described above still works incorrectly. But it became clear that the mdxToJSON query is run after it, which returns the correct 2 values.

Which query? Is it the same query you have in that GET request? I guess, most likely something wrong with filters there.

timeout for http request in the system is 60 seconds

This proves it, looks like MDX2JSON gets a query from Light Pivot Table which tries to get the whole database.

In the main pivot table, the cell, where drillthrough occurs, contains 2 records.

What is the main pivot table? Light Pivot Table? Now I'm confused. Wasn't it expected?

This is indicated for example - to show, that it will take milliseconds to execute a correct MDX query to drillthrough on this cell.

Aha, possibly the main table is DeepSee UI's table, then it makes sense.

So I assume that the problem is in DeepSee Web, which does not pass the filters correctly to Light Pivot Table. Or is it Light Pivot Table not correctly processing the drillthrough? I remember that weird parser we created to make this drillthrough work. What was the query then? However, the query might not be an answer as well, let me ask her.

'***

Asya, can you demonstrate this on the example Holefoods, for instance? 😇

nikitaeverywhere commented 4 years ago

Decided over chat to hold on this as the problem might be not on the Light Pivot Table's side.