# Delete a certain build

**URL:** <https://www.finalbuilder.com/forums/t/delete-a-certain-build/5225>\
**Category:** Discussion\
**Created:** [September 4, 2014, 9:29am UTC](https://www.finalbuilder.com/forums/t/delete-a-certain-build/5225 "2014-09-04T09:29:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [September 4, 2014, 9:29am UTC](https://www.finalbuilder.com/forums/t/delete-a-certain-build/5225/1 "2014-09-04T09:29:34Z")

</div>

Hi, would it be possible to implement a “remove” for a certain build?  
Our database has a 17GB table of “builds\_unittest”.  
  
I’ve figured out (using pgAdmin) that around 30 builds have more than 500.000 unit tests registered which is wrong

---

<div class="post-metadata">

**Author:** ![peter.toms](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/df788c/32.png) [@peter.toms](https://www.finalbuilder.com/forums/u/peter.toms)\
**Post date:** [September 5, 2014, 8:08am UTC](https://www.finalbuilder.com/forums/t/delete-a-certain-build/5225/2 "2014-09-05T08:08:11Z")

</div>

Hi Christian, thank you for posting. We have discussed internally and agree that it would be good to offer the ability to cleanup a specific build, as well as giving more granular options related to metrics via the build cleanup options (I have added these ideas to the project backlog).   
  
 In terms of handling your specific scenario, we have developed a one off datafix that I will send to you direct.   
  
 Thanks again

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [September 5, 2014, 8:44am UTC](https://www.finalbuilder.com/forums/t/delete-a-certain-build/5225/3 "2014-09-05T08:44:24Z")

</div>

yeah, sounds great.

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [September 8, 2014, 5:06am UTC](https://www.finalbuilder.com/forums/t/delete-a-certain-build/5225/4 "2014-09-08T05:06:10Z")

</div>

hi, the scripts worked. i had to remove the build handlers table because its not existing in the production version, but that was no problem.   
 however that was not the trick at all thanks again for you help.

---

<div class="post-metadata">

**Author:** ![peter.toms](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/df788c/32.png) [@peter.toms](https://www.finalbuilder.com/forums/u/peter.toms)\
**Post date:** [September 9, 2014, 5:06am UTC](https://www.finalbuilder.com/forums/t/delete-a-certain-build/5225/5 "2014-09-09T05:06:19Z")

</div>

Hi Christian thanks for the update, happy to hear that you where able to cleanup, with the VACCUM / Reindex. We have a task on our product backlog to evaluate our index usage.   
  
Thanks again for the heads up. If you could send us a ‘SELECT \* FROM pg\_stat\_all\_tables’ and the below query that would be greatly appreciated.   
  
SELECT  
&nbsp; &nbsp; t.tablename,  
&nbsp; &nbsp; indexname,  
&nbsp; &nbsp; c.reltuples AS num\_rows,  
&nbsp; &nbsp; pg\_size\_pretty(pg\_relation\_size(quote\_ident(t.tablename)::text)) AS table\_size,  
&nbsp; &nbsp; pg\_size\_pretty(pg\_relation\_size(quote\_ident(indexrelname)::text)) AS index\_size,  
&nbsp; &nbsp; CASE WHEN indisunique THEN ‘Y’  
&nbsp; &nbsp; &nbsp; &nbsp;ELSE ‘N’  
&nbsp; &nbsp; END AS UNIQUE,  
&nbsp; &nbsp; idx\_scan AS number\_of\_scans,  
&nbsp; &nbsp; idx\_tup\_read AS tuples\_read,  
&nbsp; &nbsp; idx\_tup\_fetch AS tuples\_fetched  
FROM pg\_tables t  
LEFT OUTER JOIN pg\_class c ON t.tablename=c.relname  
LEFT OUTER JOIN  
&nbsp; &nbsp; ( SELECT c.relname AS ctablename, ipg.relname AS indexname, x.indnatts AS number\_of\_columns, idx\_scan, idx\_tup\_read, idx\_tup\_fetch, indexrelname, indisunique FROM pg\_index x  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;JOIN pg\_class c ON c.oid = x.indrelid  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;JOIN pg\_class ipg ON ipg.oid = x.indexrelid  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;JOIN pg\_stat\_all\_indexes psai ON x.indexrelid = psai.indexrelid )  
&nbsp; &nbsp; AS foo  
&nbsp; &nbsp; ON t.tablename = foo.ctablename  
WHERE t.schemaname='public’  
ORDER BY 1,2;  
  
Thanks again for your support

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [September 9, 2014, 4:21am UTC](https://www.finalbuilder.com/forums/t/delete-a-certain-build/5225/6 "2014-09-09T04:21:53Z")

</div>

Sent to you via mail.

---

<div class="post-metadata">

**Author:** ![peter.toms](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/df788c/32.png) [@peter.toms](https://www.finalbuilder.com/forums/u/peter.toms)\
**Post date:** [September 10, 2014, 1:07am UTC](https://www.finalbuilder.com/forums/t/delete-a-certain-build/5225/7 "2014-09-10T01:07:20Z")

</div>

Hi Christian, many thanks for this information we really appreciate it
