Skip to content

Instantly share code, notes, and snippets.

View kraken-chris's full-sized avatar

Chris Huffman kraken-chris

  • Kraken Commerce
  • Springfield, MO
View GitHub Profile
@perryholden
perryholden / debug_elasticsearch.txt
Last active October 11, 2023 15:09
Debug Elasticsearch Results
\Magento\Elasticsearch7\SearchAdapter\Adapter::query (This kicks off the entire request)
\Elasticsearch\Connections\Connection::performRequest line 210 (This is the formatted $body variable)
Take the serialized $body varable, then replace the -d argument with the contents:
curl -H 'Content-Type: application/json' -XPOST "http://elasticsearch:9200/magento2_product_1/_search?pretty" -d'{
"from": 0,
"size": 48,
"stored_fields": "_none_",
"docvalue_fields": [
@chris-huffman
chris-huffman / query_largest_tables.sql
Created January 13, 2021 17:56
Gets the 10 largest tables in a db.
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;