SQL speed on non-pk'd tables - Posted (3592 Views)
Average Member
SiSL
Posts: 671
671
Greetings,

I'm wondering if there is any way to speed up tables with no-primary keys (you know tables inserting records non-stop and deleting) where int or bigint will be a problem....where you store massive number of records that may change during... eg. like Active_users table

Since yesterday hit over 25K active at same time, 194K overall visit, I think one of reasons for that to update that file while users changing pages.

 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
I guess the question is how those tables are accessed and what type of performance problems you're experiencing.
Posted
Average Member
SiSL
Posts: 671
671
Well, you know Active_Users table of Snitz. Very same :)
My performance problem is while users of 24K around same periods access data as they change pages, active users change pages as well.. So around 24K queries on a no-PK'd table sadly in less than 20 minutes periods.
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
In what pages does that slow you down? Every page? Active users page?
Posted
Average Member
SiSL
Posts: 671
671
Every page that calls activepages function (you know the function that adds users to list if they are not, or changes their location if they were already in the table)
Not listing or anything.
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
Well I will try to have a look at what it does.
Posted
Average Member
SiSL
Posts: 671
671
Thank you, it is in general, massive files with no PK naturally takes a lot more to operate. I was wondering if there are other options for such "log-style" tables to operate quicklier if given paramaters good enough.
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
Forgot this, Selçuk, sorry. Only remembered it by seeing your latest post. Please bump it if I say nothing else today...
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
Try adding an index to the MEMBER_ID field and another to the AU_IP field. Both should be non clustering indexes. This should speed getting table data and deleting members, but it may slow adding members to the list...
Let me know if it makes any difference.
Posted
Average Member
SiSL
Posts: 671
671
You Must enter a message