Shaare your links...
1138 links
Shaarli : Simon Leblanc Home Login RSS Feed ATOM Feed Tag cloud Picture wall Daily
Links per page: 20 50 100
page 1 / 1
16 results for tags sql x
  • MySQL: selecting a number of random rows fast at EXPLAIN EXTENDED
    Comment sélectionner des lignes de manière aléatoire en SQL en réduisant le moins possible la performance
    Mon Sep 4 18:10:34 2017 - permalink -
    - https://explainextended.com/2009/03/01/selecting-random-rows/
    aléatoire random sql
  • EventQL - The database for large-scale event analytics
    Une base de données dédiée au événements. Cela permettrait d'être plus rapide pour faire des stats
    Tue Oct 4 23:49:37 2016 - permalink -
    - https://eventql.io/
    event sql
  • thumbnail
    SQL Cheat Sheet
    Wed Aug 24 11:13:59 2016 - permalink -
    - http://korben.info/wp-content/uploads/2016/07/rebellabs-sql-cheat-sheet.png
    cheatsheet sql
  • Script de correction d'une table en arbre avec des parent_id
    DROP PROCEDURE IF EXISTS tree_recover;

    DELIMITER //

    CREATE PROCEDURE tree_recover ()
    MODIFIES SQL DATA
    BEGIN

       DECLARE currentId, currentParentId  CHAR(36);
       DECLARE currentLeft                 INT;
       DECLARE startId                     INT DEFAULT 1;

       # Determines the max size for MEMORY tables.
       SET max_heap_table_size = 1024 * 1024 * 512;

       START TRANSACTION;

       # Temporary MEMORY table to do all the heavy lifting in,
       # otherwise performance is simply abysmal.
       CREATE TABLE `tmp_tree` (
           `id`        char(36) NOT NULL DEFAULT '',
           `parent_id` char(36)          DEFAULT NULL,
           `lft`       int(11)  unsigned DEFAULT NULL,
           `rght`      int(11)  unsigned DEFAULT NULL,
           PRIMARY KEY      (`id`),
           INDEX USING HASH (`parent_id`),
           INDEX USING HASH (`lft`),
           INDEX USING HASH (`rght`)
       ) ENGINE = MEMORY
       SELECT `id`,
              `parent_id`,
              `lft`,
              `rght`
       FROM   `tree`;

       # Leveling the playing field.
       UPDATE  `tmp_tree`
       SET     `lft`  = NULL,
               `rght` = NULL;

       # Establishing starting numbers for all root elements.
       WHILE EXISTS (SELECT * FROM `tmp_tree` WHERE `parent_id` IS NULL AND `lft` IS NULL AND `rght` IS NULL LIMIT 1) DO

           UPDATE `tmp_tree`
           SET    `lft`  = startId,
                  `rght` = startId + 1
           WHERE  `parent_id` IS NULL
             AND  `lft`       IS NULL
             AND  `rght`      IS NULL
           LIMIT  1;

           SET startId = startId + 2;

       END WHILE;

       # Switching the indexes for the lft/rght columns to B-Trees to speed up the next section, which uses range queries.
       DROP INDEX `lft`  ON `tmp_tree`;
       DROP INDEX `rght` ON `tmp_tree`;
       CREATE INDEX `lft`  USING BTREE ON `tmp_tree` (`lft`);
       CREATE INDEX `rght` USING BTREE ON `tmp_tree` (`rght`);

       # Numbering all child elements
       WHILE EXISTS (SELECT * FROM `tmp_tree` WHERE `lft` IS NULL LIMIT 1) DO

           # Picking an unprocessed element which has a processed parent.
           SELECT     `tmp_tree`.`id`
             INTO     currentId
           FROM       `tmp_tree`
           INNER JOIN `tmp_tree` AS `parents`
                   ON `tmp_tree`.`parent_id` = `parents`.`id`
           WHERE      `tmp_tree`.`lft` IS NULL
             AND      `parents`.`lft`  IS NOT NULL
           LIMIT      1;

           # Finding the element's parent.
           SELECT  `parent_id`
             INTO  currentParentId
           FROM    `tmp_tree`
           WHERE   `id` = currentId;

           # Finding the parent's lft value.
           SELECT  `lft`
             INTO  currentLeft
           FROM    `tmp_tree`
           WHERE   `id` = currentParentId;

           # Shifting all elements to the right of the current element 2 to the right.
           UPDATE `tmp_tree`
           SET    `rght` = `rght` + 2
           WHERE  `rght` > currentLeft;

           UPDATE `tmp_tree`
           SET    `lft` = `lft` + 2
           WHERE  `lft` > currentLeft;

           # Setting lft and rght values for current element.
           UPDATE `tmp_tree`
           SET    `lft`  = currentLeft + 1,
                  `rght` = currentLeft + 2
           WHERE  `id`   = currentId;

       END WHILE;

       # Writing calculated values back to physical table.
       UPDATE `tree`, `tmp_tree`
       SET    `tree`.`lft`  = `tmp_tree`.`lft`,
              `tree`.`rght` = `tmp_tree`.`rght`
       WHERE  `tree`.`id`   = `tmp_tree`.`id`;

       COMMIT;

       DROP TABLE `tmp_tree`;

    END//

    DELIMITER ;
    Wed Mar 30 12:37:58 2016 - permalink -
    - http://stackoverflow.com/a/3634268
    arbre sql tree
  • GitHub - kennethreitz/records: SQL for Humans™
    Une bibliothèque Python permettant de faire facilement des exports de résultats de requête SQL (tableau, json, yaml, ...)
    Mon Mar 14 01:07:34 2016 - permalink -
    - https://github.com/kennethreitz/records
    export python sql
  • SQL style guide by Simon Holywell
    Une convention de codage pour SQL
    Sat Aug 29 14:21:15 2015 - permalink -
    - http://www.sqlstyle.guide/
    coding convention convention de naming nommage sql style
  • Symfony tips and tricks
    Des conseils pour Symfony et son eco-systeme.
    Tue Dec 2 00:53:25 2014 - permalink -
    - http://fr.slideshare.net/javier.eguiluz/symfony-tips-and-tricks
    2 cache doctrine sql symfony symfony
  • SQL Naming conventions
    Une convention de nommage pour SQL avec les explications des choix
    Tue Feb 18 20:17:33 2014 - permalink -
    - https://launchbylunch.com/posts/2014/Feb/16/sql-naming-conventions/
    convention convention de naming nommage sql
  • How to Design Indexes, Really
    Des explications sur l'utilisation des index afin d'utiliser correctement MySQL
    Sun Oct 13 12:06:45 2013 - permalink -
    - http://www.slideshare.net/slideshow/embed_code/14886467
    index mysql performance sql
  • explain.depesz.com
    Un outil permettant de mettre en forme le resultat d'un explain d'une requete SQL
    Tue Oct 8 11:03:47 2013 - permalink -
    - http://explain.depesz.com/
    explain mysql postgresql query query slow sql
  • Cheat Sheet Roundup - Over 30 Cheatsheets for developers
    Des cheat sheet pour developpeurs sur le CSS, SQL, les regexp, html, PHP, ...
    Tue Mar 12 09:55:43 2013 - permalink -
    - http://www.petefreitag.com/item/455.cfm
    cheatsheet css html javascript php regexp sql
  • Creating Backdoors Using SQL Injection
    Un article detaillant comment creer une backdoor php en profitant d'une injection SQL
    Mon Feb 6 15:45:44 2012 - permalink -
    - http://resources.infosecinstitute.com/backdoor-sql-injection/
    injection securite sql sqli
  • MySQL :: Using the New MySQL Query Profiler
    Tue Nov 23 22:11:03 2010 - permalink -
    - http://dev.mysql.com/tech-resources/articles/using-new-query-profiler.html
    database db development mysql optimization performance profile profiler profiling sql tool tools
  • LiquiBase | Database Refactoring | home
    Gestionnaire de version de base de données
    Tue Oct 26 00:45:30 2010 - permalink -
    - http://liquibase.org/
    database db development management opensource programming refactoring sql tool tools versioning
  • Limiter la complexité du code applicatif grâce au SGBD - Club d'entraide des développeurs francophones
    Thu Apr 3 21:19:30 2008 - permalink -
    - http://alain-defrance.developpez.com/articles/SGBD/contraintes/
    base_de_données contrainte développement php sql
  • Security Compass - Application Security Canada
    Thu Jan 3 13:47:41 2008 - permalink -
    - http://www.securitycompass.com/exploitme.shtml
    extension firefox injection scurit sql xpi xss
Links per page: 20 50 100
page 1 / 1
Shaarli 0.0.41 beta - The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net. Theme by idleman.fr.