Just delete 50.000.000 of rows on a PostgreSQL table and DB still very slow

sorry for my poor english.

I have a postgres DB runing on amazon RDS (db.t3.small), with django as a backend. i have made a mistake and created 50.000.000 rows. when i figure out (because queries on that table where ultra slow) i delete it all. but the queries i make on that table stills super slow. it only have 300 rows now.

i have to clean some cache? i have to wait something? the configuration of the RDS in aws is default.

the engine version of postgres is 12.5, also have postgis installed in it.

i check for vacuum issues and run this command:

SELECT relname AS TableName,n_live_tup AS LiveTuples,n_dead_tup AS DeadTuples,last_autovacuum AS Autovacuum,last_autoanalyze AS Autoanalyze FROM pg_stat_user_tables; 

the table with the problem says:

'appointment_timeslot', 1417, 0, datetime.datetime(2021, 7, 21, 18, 13, 8, 193967, tzinfo=<UTC>), datetime.datetime(2021, 7, 21, 18, 13, 30, 551750, tzinfo=<UTC>) 

check for indexes that Django creates automaticly on that table and i find 4

[ ('appointment_timeslot_pkey', 'CREATE UNIQUE INDEX appointment_timeslot_pkey ON public.appointment_timeslot USING btree (id)') 'appointment_timeslot_home_visit_id_62df4faf', 'CREATE INDEX appointment_timeslot_home_visit_id_62df4faf ON public.appointment_timeslot USING btree (home_visit_id)') ('appointment_timeslot_office_id_6871b47b', 'CREATE INDEX appointment_timeslot_office_id_6871b47b ON public.appointment_timeslot USING btree (office_id)') ('appointment_timeslot_time_range_id_715578fa', 'CREATE INDEX appointment_timeslot_time_range_id_715578fa ON public.appointment_timeslot USING btree (time_range_id)') ] 

How to select and delete all Output cells within current Selection only?

A similar question was already here: How to select and delete all Output cells?. But I have a more specific one: I want to delete all output cells within the currently selected cells only.

For this purpose I want to add an additional menu item Cell>Delete All Output within Selection.

Probably one would have to add something to

/usr/local/Wolfram/Mathematica/12.1/SystemFiles/FrontEnd/TextResources/X/MenuSetup.tr

Has anybody already made such an improvement and could he please post it here?

(The version in this case is 12.1 and it probably has to reflect the version in question. This path is for a Linux machine. On a Windows machine the paths begin at a different root but parts from Wolfram to TextRessources probably will look the same, except for the forward slashes being replaced by backward ones- /X/ might be special for Linux).

How to properly delete unwanted models

I am implementing bullets into my game, and each bullet has a lifetime. Whenever the bullet has existed for a set amount of time or collides with an object, the bullet should be deleted. I implemented the timer properly and whenever the bullet reaches the end of its life, it gets deleted. The problem occurs whenever I shoot another bullet. This instantly causes a crash with the code: Exception thrown at 0x044765D7 (nvoglv32.dll) in gravityGame.exe: 0xC0000005: Access violation reading location 0x00000000.

After some research, I’ve found that this usually means that I am trying to render something that is a nullptr. My thinking is that I am not deleting the previous bullet properly and this affects the new one. A single bullet object is created on startup, and every new bullet is copied using the following line of code:

std::shared_ptr<Bullet> bullet = std::make_shared<Bullet>(*std::dynamic_pointer_cast<Bullet>(modelsLoaded.at(i)));

The reason for the dynamic pointer cast is because it is in a vector of its base class that it inherits from. Whenever the bullet needs to get deleted, it is erased from the bullets vector using bullets.erase(bullets.begin()+index); and the object it is pointing to should go out of scope, there is nothing else pointing to it. I feel like somehow having that object getting deleted has an adverse effect on the other bullets in the vector, but I do not know how. A new object is created and all the data from the original bullet gets copied over. How could deleting a copy of an object mess with the other copied objects? The functions to create, and render the models are below.

Generate Model Function

    //binds id     glGenBuffers(1, &VBO);     glGenVertexArrays(1, &VAO);     glGenBuffers(1, &EBO);     glGenTextures(1, &texture);     glBindVertexArray(VAO);     glBindBuffer(GL_ARRAY_BUFFER, VBO);     glBufferData(GL_ARRAY_BUFFER, verticesSizeTexture * 8 * sizeof(float), verticesTexture, GL_STATIC_DRAW);     // position attribute     glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)0);     glEnableVertexAttribArray(0);     // color attribute     glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)(3 * sizeof(float)));     glEnableVertexAttribArray(1);     glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);     glBufferData(GL_ELEMENT_ARRAY_BUFFER, indicesSizeTexture * 4, indicesTexture, GL_STATIC_DRAW);     //texture     glBindTexture(GL_TEXTURE_2D, texture);     glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)(6 * sizeof(float)));     glEnableVertexAttribArray(2);      glBindBuffer(GL_ARRAY_BUFFER, 0);     glBindVertexArray(0); 

Rendering Function

    unsigned int transformLoc = glGetUniformLocation(shader->ID, "location");         glUniformMatrix4fv(transformLoc, 1, GL_FALSE, glm::value_ptr(trans));      glBindTexture(GL_TEXTURE_2D, texture);        glBindVertexArray(VAO);      glDrawElements(GL_TRIANGLES, indicesSizeTexture, GL_UNSIGNED_INT, 0);     glBindVertexArray(0);    

Destructor

glDeleteVertexArrays(1, &VAO); glDeleteBuffers(1, &VBO); glDeleteBuffers(1, &EBO); 

Update After removing the contents of the destructor, the problem goes away. However, I would like to have some sort of destructor to allow for the proper freeing of memory.

How do I delete a user from the master database when the user has been deleted from the Server Logins using the SSMS Object Explorer

I am using an Azure SQL Database. I deleted some users from a Azure SQL database after I saw them mentioned in a Vulnerability Assessment report. Here’s how I deleted them:

  1. Log in to SSMS
  2. Expand the Object Explorer tree
  3. Expand the ‘Security’ folder
  4. Expand the ‘Logins’ folder
  5. Highlight the user
  6. Right-click and select ‘Delete’

I went back to the Vulnerability Assessment blade and ran a new ‘Scan’ but the users I deleted still show up in the list. The list included SQL code to show that my users still exist. I ran that code back in SSMS in the master database and confirmed my users still exist. Here’s the relevant code:

SELECT * FROM sys.database_principals

When I run the following code, I get an error saying the user does not exist (‘or you do not have permission’ – but I am a server admin so I ruled that out):

DROP LOGIN <username>

How do I get rid of these logins?

Can’t delete Draft Post

I am new to wordpress and was happily blogging along when I ran into a weird issue. I tried uploading a gif into the draft and the editor crashed. I refreshed the browser and then found that I couldn’t access all posts or the drafts of posts from my post dashboard.

Where you would expect to see the table of posts I see this error, and the drafts table doesn’t populate at all despite showing one draft:enter image description here

You’ll notice the posts I created after the error no problem, but the posts from before the error aren’t shown.

I tried following the guides I could online to fix the issue, and I figured out that when I disable all my plugins I can see it in the drafts: enter image description here

However, when I try to ‘trash’ the draft, it gives me a critical error.

Please let me know if there is any additional troubleshooting information that you need to help, otherwise thank you for your time and attention.

Should I write custom allocators for STL containers to interface with my memory pool, or just overwrite the standard new and delete

I want to write a custom memory allocator for learning. I’m tempted to have a master allocator that requests n bytes of ram from the heap (via new). This would be followed by several allocator… Adaptors? Each would interface with the master, requesting a block of memory to manage, these would be stack, linear, pool, slab allocators etc.

The problem I have is whether I should write custom allocator_traits to interface with these for the various STL containers; or if I should just ignore the adaptor idea and simply overload new and delete to use a custom pool allocator.

What I’m interested in understanding is what tangible benefit I would gain from having separate allocators for STL containers? It seems like the default std::allocator calls new and delete as needed so if I overload those to instead request from my big custom memory pool, I’d get all the benefit without the kruft of custom std::allocator code.

Or is this a matter where certain types of allocator models, like using a stack allocator for a std::dqueue would work better than the default allocator? And if so, wouldn’t the normal stl implementation already specialise?

How do you delete 16 000 pages or start from scratch again [closed]

Someone hijacked my google search console for a while and he uploaded tons of sitemap with 16 000 website total.

I’d like to return to the way it was before, i asked for the sitemaps to be deleted but the pages are still there (it’s been 2 weeks already)

I was starting to ask myself if i couldn’t just start from scratch again and delete everything from google, is that possible or simply delete the right pages, and how

Thanks

how to delete specific range of data from system queue data table?

due to sudden increase of my database .mdf file we check there are 4 internal queue message table are increase unexpectedly. so we decided to delete some range of data from these table.

we try this code:

declare @c uniqueidentifier while(1=1) begin     select top 1 @c = conversation_handle from dbo.queuename     if (@@ROWCOUNT = 0)     break     end conversation @c with cleanup end   

but its try to delete all data and due to space limitation the query cannot execute. my internal message queue table :

enter image description here

enter image description here